Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
12:34 am Jul 24, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
preg replace list items
alphacooler
Msg#:3107762
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
Msg#:3107978
10:41 am on Oct 4, 2006
(gmt 0)
Do a
preg_replace
[php.net] with pattern
^(.+)$
and replacement
<li>$1</li>
.
eelixduppy
Msg#:3108000
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.
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Jun
,
May
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
July 2026 Google Search Observations
Annoying Crawler, Bot, or what?
Do you still build external links in 2026?
Suspicious visitors
Home
Forums Index
Server Side
/
PHP Server Side Scripting
12:34 am Jul 24, 2026