从ob_get_clean()输出中删除换行符

ok i do have this following codes

<?php
ob_start();
?>
codepad is an 
online compiler/interpreter, 
and a simple collaboration tool.
Paste 

your code below, 
and codepad wi
ll run 
it and give you a short 
URL you can use to share
 it in chat or email
<?php
$str = str_replace('
','',trim(ob_get_clean()));
echo $str;
?>

and you can see how it works here http://codepad.org/DrOmyoY9

now what i want here is to remove the newlines from the stored output of the ob_get_clean().

I almost looked around the internet on how to remove newlines in the strings and that's the common and fastest method to remove the newlines aside from using the slowly preg_replace().

Why this happens? is this already a bug? or i just missed something?

is windows style, but if the user using linux or mac, it would be different . so best solution is:

$str = str_replace(array("","
"),'',trim(ob_get_clean()));

I think u miss one thing, it should be :

$str = str_replace("
",'',trim(ob_get_clean()));

using double quotes not single quotes