Replace line breaks with a comma

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Replace line breaks with a comma

Post by GeXus »

I have a long list that is broken up by line breaks... But I would like to break up this list by comma instead and remove the line breaks, or replace..

Could anyone tell me how I would do this? Thanks!
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Code: Select all

str_replace("\n", ",", $string);
Post Reply