WeberSites LTD dedi ki:
> Thanks, I'll have a look at it.
>
> I do want to allow some chars so I'm trying to replace them
> like this :
>
> $post_text=str_replace(chr(146),"'",$post_text);
>
> or
>
> $post_text=str_replace("","'",$post_text);
>
>
> However, it seems that str_replace does not actually replace
> the chars cause they still end up in the output.
>
> any idea?
It works for me:
echo str_replace(chr(146),"'",str_repeat("X".chr(146)."Y", 10));
X'YX'YX'YX'YX'YX'YX'YX'YX'YX'Y
Also: (should be lighter and faster than str_replace, I think)
echo strtr(str_repeat("X".chr(146)."Y", 10), chr(146), "'");
X'YX'YX'YX'YX'YX'YX'YX'YX'YX'Y
It might be related to your input - perhaps not 8-bit clean? Perhaps
preprocessed in some way through the pipe (network, linux, apache, php.ini
settings, etc.) before it reached your script? Hard to guess.
I would've written (in binary safe way) the input to a temp file and then
inspected it via hexdump, less, hexedit etc.
Kind regards,
--
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php