Welcome to WebmasterWorld Guest from 54.162.213.67

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

preg replace list items

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

Full Member

10+ Year Member

joined:Feb 4, 2005
posts:205
votes: 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)

New User

10+ Year Member

joined:Jan 4, 2005
posts:35
votes: 0


Do a preg_replace [php.net] with pattern ^(.+)$ and replacement <li>$1</li>.
10:54 am on Oct 4, 2006 (gmt 0)

Senior Member

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

joined:Nov 12, 2005
posts:5966
votes: 0


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