Possible Duplicate:
How do I read a “,” as “<br />” in PHP/MySQL?
This is my code:
$result = mysql_query("SELECT * FROM characters WHERE namn = 'Jargon'");
while($row = mysql_fetch_array($result))
{
echo "<div class='content_left'>";
echo "<div class='blue_text_header'>Information</div>";
echo "<h1>";
echo $row['Namn'];
echo "</h1>";
echo "<br /><br /><br /><br /><br /><br /><br />";
echo "<div class='red_text_header'>Obekräftade fall</div>";
echo " " . $row['unconfirmed'];
echo "</div>";
echo "<div class='content_right'>";
echo "<div class='orange_text_header'>Andra namn</div>";
echo $row['Alias'];
echo "<br />";
echo "<br /><br /><br /><br /><br /><br /><br /><br />";
echo "<div class='green_text_header'>Bekräftade fall</div>";
echo " " . $row['confirmed'];
}
mysql_close($con);
?>
And the output for “Alias” is for example: hello,no thanks,I don’t like you
but instead I want the output to be like:
hello
no thanks
I don’t like you
What I mean is I want to switch every coma for a line break and how do I do that and where do I put the code? I made another question, but I forgot to ask where to put the code, I don’t know PHP, most is just copy paste and it’s for a project that has to be done 2morrow.
Use the str_replace() function.
http://php.net/manual/en/function.str-replace.php