Re: PHP editor
| From: | Curt Zirzow | Date: | Thu, 15 Apr 2004 20:21:22 +0000 |
| Subject: | Re: PHP editor | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183562@lists.php.net to get a copy of this message | ||
* Thus wrote John W. Holmes (holmes072000@charter.net):
> From: "Chris Boget" <chris@wild.net>
>
> > > function cleanFinalOutput($html){
> > > $return = eregi_replace("\n", "", $html);
> > > $return = eregi_replace("\r", "", $return);
> > > return eregi_replace("\t", "", $return);
> > > }
> >
> > Not to be too pedantic, but you could probably reduce the above
> > to a single line function:
> >
> > function cleanFinalOutput($html){
> > return eregi_replace("\n", "", eregi_replace("\r",
> > "",
> eregi_replace("\t",
> > "", $html )));
>
> Certainly don't need to fire up the regex engine.
>
> return str_replace(array("\r","\n","\t"),'',$html);
and yet another way:
return strtr($html, array("\t" => '', "\n" => '',
"\r" => ''))
Curt
--
"I used to think I was indecisive, but now I'm not so sure."