How can I output a string with it's newline characters visible in php? -


i have string newlines i'd print out see special chars (such \n) rather newlines themselves.

so string typically echo'd

this top line of string second line of string 

would instead this:

this top line of string\nthis second line of string 

how accomplish in php?

try this:

<?php  $string = "this top line of string second line of string";  echo json_encode($string);  ?> 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -