I cannot get the below array to replace the carriage return and newline with an HTML break <br />
JSON Array:
{"Fruit":"Apple","Veggies":"Carrot\r\nCelery\r\n\r\nCucumbers"}
I'm trying this and having no luck:
$html = json_decode(nl2br($json),true);
The line breaks are visible in the source code of the HTML itself however I cannot get the <br />
code to replace the 'newlines'.
I've tried this suggestion as well and it did not work either: Replacing \r\n (newline characters) after running json_encode
Run nl2br()
after JSON is decoded, not on the JSON array source.