Forum Moderators: coopster

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)



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