Welcome to WebmasterWorld Guest from 54.167.22.37

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

preg replace list items

     

alphacooler

3:46 am on Oct 4, 2006 (gmt 0)

10+ Year Member



I would like to wrap <li></li> tags around each newline.

How would I go about this?

GoldFish

10:41 am on Oct 4, 2006 (gmt 0)

10+ Year Member



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

eelixduppy

10:54 am on Oct 4, 2006 (gmt 0)

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



You have to make sure you use the m pattern modifier [us2.php.net] for the above to work.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month