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
6:43 am May 23, 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
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AI visibility audit
AdSense Earnings and Observations - May 2026
Page indexed but live url test gets 500 error
AI Generated Content vs Human Written Content: What Does Google Prefer
Early Observations on UCP and the Direction of SEO
in case you missed it .
Hacker spoofing as GoogleBot
Adsense / Personal Manager / Support
Google I/O 2026: Impact on Directory Sites & Google-Extended Policy?
Home
Forums Index
Server Side
/
PHP Server Side Scripting
6:43 am May 23, 2026