homepage Welcome to WebmasterWorld Guest from 23.20.61.85
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
preg replace list items
alphacooler

5+ Year Member



 
Msg#: 3107760 posted 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?

 

GoldFish

5+ Year Member



 
Msg#: 3107760 posted 10:41 am on Oct 4, 2006 (gmt 0)

Do a preg_replace [php.net] with pattern ^(.+)$ and replacement <li>$1</li>.

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 3107760 posted 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved