From the manual for chr()
Returns a one-character string containing the character specified by ascii.
It replaces one (1) character, not a string
-Original Message-
From: Ando [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 6:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP]
Not sure what you mean here
$text= ereg_replace('#([0-9]+);' , chr('\1') , $text);
should replace for example #65; with chr('65') (\1 means everything in
brackets in regular expression), which is 'A' .
Rick Emery wrote:
From the manual for chr()
Returns a one-character string containing
:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 7:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ereg_replace or chr bug?
Not sure what you mean here
$text= ereg_replace('#([0-9]+);' , chr('\1') , $text);
should replace for example #65; with chr('65') (\1 means everything in
brackets
, ereg_replace() fails and simply returns the original string, $text.
-Original Message-
From: Ando [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 7:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] ereg_replace or chr bug?
Not sure what you mean here
$text= ereg_replace('#([0
4 matches
Mail list logo