Reputation: 59
Can anyone help with this formatting. I have a paragraph in a database with says (for example) 'black;blue;green' and I want to call it from the db and the format all the ; to be new lines \n.
so it becomes
black
blue
green
Any ideas?
Upvotes: 0
Views: 50
Reputation: 3
$str = str_replace(";", "\n", $string);
Finds the ;
and replaces it by newline.
Upvotes: 0