note 50413 added to function.ereg-replace

From: Date: Sun, 27 Feb 2005 19:44:46 +0000
Subject: note 50413 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-85643@lists.php.net to get a copy of this message
<?php $path = ereg_replace("\\", "/", $path); ?> as posted from mmtach at yahoo dot com causes an error because you have to escape the backslash twice, once for the quotation marks and a second time due the posix syntax. <?php $path = ereg_replace("\\\\", "/", $path); ?> or <?php $path = ereg_replace('\\', "/", $path); ?> should both work as expected. since you don't have to escape the backslash in brackets (posix syntax) his alternative works also. ---- Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+50413 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50413&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50413&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50413&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50413&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50413&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+50413&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#85643) next »