Jump to content

[SOLVED] Help with str_replace - Should be a QUICK FIX


JSHINER

Recommended Posts

Here is my code:

$string = $z['description'];

	$string = wordwrap($string, 225, "|", 1);
	list($string) = explode('|', $string);

	echo'<br>';

	echo str_replace("\n", '<br />', str_replace("\r\n", '<br />', str_replace("\n\n", '', str_replace("\r\n\r\n", '', htmlspecialchars($string)))));

 

Works fine EXCEPT str_replace / htmspecialcharcters are not working. Do I have str_replace in the wrong spot? Should it be done before the wordwrap? Or before I define $z['description'] as the $string varialbe?

 

Any help would be much appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.