| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe and Support WebmasterWorld|
|preg replace list items|
| 3:46 am on Oct 4, 2006 (gmt 0)|
I would like to wrap <li></li> tags around each newline.
How would I go about this?
| 10:41 am on Oct 4, 2006 (gmt 0)|
Do a preg_replace [php.net] with pattern ^(.+)$ and replacement <li>$1</li>.
| 10:54 am on Oct 4, 2006 (gmt 0)|
You have to make sure you use the m pattern modifier [us2.php.net] for the above to work.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved