|
Posted by J.O. Aho on 01/16/07 11:59
severin wrote:
> Hi all,
>
> I try "update mybase set name = trim(name)"
>
> to skip spaces.
>
> But 'charriot return'
> (\13\10) are always here.
>
> How can i remove ( or select ) all invisible characteres??
The placement of the "whitespaces" are important when using trim(), it takes
only those that are in the beginning or/and end of the string.
so if you have a string like, "hello\n\rThis is my string", trim will give you
the string "hello\n\rThis is my string" as the charterers in question are in
the middle of the string.
http://www.php.net/manual/en/function.trim.php
If you want to trim characters in the middle of a string, you may want to use
something like eregi_replace().
$newstring=eregi_replace("\n\r",'',"hello\n\rThis is my string");
// $newstring="helloThis is my string"
http://www.php.net/manual/en/function.eregi-replace.php
--
//Aho
[Back to original message]
|