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
4:45 pm Aug 11, 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
,
Jul
,
Jun
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
August 2026 Google Search Observations
AdSense Earnings and Observations - August 2026
Meta Description
Booking Feels Google AI Effects - Plans SEO decline
EU AI Transparency Rules Now in Effect
IbouBot
How has AI changed your work?
Do you still build external links in 2026?
Home
Forums Index
Server Side
/
PHP Server Side Scripting
4:45 pm Aug 11, 2026