At 08:43 14.03.2003, Dennis Gearon said:
--------------------[snip]--------------------
>I finally got something to do it, at least, in inline code.
>
>I couldn't figure out how to remove NULLS, anybody know? A search on:
--------------------[snip]-------------------- 

I just found this thread, pardon me if I'm off topic, but something like
this should work for you. It makes use of the fact that all of the replace
functions can take arrays as input parameters.

$from = array("/(\r\n)+/", "/(\n\r)+/", "/(\r)+/", "/[\x0..\x19]/");
$repl = array("\n", "\n", "\n", null);
$str_cleaned = preg_replace($from, $to, $str_uncleaned);

This construction should convert the occurrence of one or more successive
newline combinations with a single newline character, and remove control
characters at large (untested).


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to