> hi guys trikky question , i would like to ignore html in content that
i am
> replacing news lines with page breaks , how is it possible ? at the
moment
> and
> new line like so \r\n in content will be replaced with a <br> but
happens
> to
> work on say tables tags within the content aswell and need to ignore
this.

You'll have to make your own function that only matches data between
<td> and </td> (or whatever you're looking for) and then applies nl2br()
only to that section...

For example:

preg_replace("!<td>(.*)</td>!Ues","nl2br('<td>$1</td>')",$var);

will match only what's between <td> and </td> tags and apply nl2br() to
the data. It will leave everything else along. Adapt to your needs,
there may be better methods...

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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

Reply via email to