note 45824 added to function.ereg-replace

From: Date: Mon, 20 Sep 2004 15:08:34 +0000
Subject: note 45824 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-77058@lists.php.net to get a copy of this message
Hi everybody! I've noticed that the function ereg_replace() has a problem when working with getcwd(), at least under WinXP Pro, Apache 2.0 and PHP 4.3.6... for example, trying to change the backslashes for normal slashes by this way: $curr_dir=getcwd(); $progr_dir=ereg_replace('\', "/", $curr_dir); ... doesn't work! $curr_dir=getcwd(); $progr_dir=ereg_replace("\\", "/", $curr_dir); ... this one doesn't work too! $curr_dir=getcwd(); $progr_dir=str_replace('\', "/", $curr_dir); ... not this one, also! This gave me a big headache, but fortunately I got the solution: $curr_dir=getcwd(); $progr_dir=str_replace("\\", "/", $curr_dir); ...strange, isn't it? ---- Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+45824 Delete -- http://master.php.net/manage/user-notes.php?action=delete+45824&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+45824&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#77058) next »