[HELP] Percent sign replacement.

From: Date: Sat, 10 Jan 2004 00:30:47 +0000
Subject: [HELP] Percent sign replacement.
Groups: php.lang 
Request: Send a blank email to php-lang+get-545@lists.php.net to get a copy of this message
Hi, I have written the following code to parse the incoming text from a <textarea> so that PHP chars like " or \ are replaced with their respective alt-codes. $strBodyText1 = $_POST['message']; $strBodyText2 = str_replace(array("\'", '\"', '\\', "%%"), array('\'', '&quot', '&#092', '&#037'), $strBodyText1); printf($strBodyText); This code work well until a percent sign (%) comes into action. Somehow it's not recognised by the code and I get a huge printf() error. The error is as followed: Warning: printf() [function.printf]: Too few arguments in /home/users/g/i/gimmic/www/brugadvies/rtb/function.php on line 91 I have searched for a sollution, but couldn't find one. Any idea how this issue can be resolved? Thanks in advance for your effort! Cheers, Alexander

« previous php.lang (#545) next »