|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-04 02:54 UTC] yohgaki@php.net
[2002-04-24 09:43 UTC] josef dot svoboda at email dot cz
[2002-08-14 14:44 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 02:00:01 2025 UTC |
The goal is to replace sequence of two backslashes in $text by one backslash. While preg_replace works, ereg_replace does not make any change to $text. echo "preg_replace\n"; $text="\\\\"; echo "--".$text."--".strlen($text)."\n"; $text=preg_replace( "/\\\\\\\\/", "\\\\", $text); echo "--".$text."--".strlen($text)."\n"; echo "\n"; echo "ereg_replace\n"; $text="\\\\"; echo "--".$text."--".strlen($text)."\n"; $text=ereg_replace( "\\\\\\\\", "\\\\", $text); echo "--".$text."--".strlen($text)."\n"; ./configure \ --with-mysql=/usr/local/mysql \ --with-imap=/usr/ports/new/imap \ --enable-track-vars \ --enable-trans-sid