here is my problem:
I want output a formatted array on my webserver, like this:
{
"status": true,
"motd": " [ Mineplex Games ] \n \u2744 New Game \u2744 Gladiators \u2744",
"version": "1.8",
"players": {
"online": 24410,
"max": 24411
},
"ping": "0.039",
"cache": 1450047242
}
In the source of that page there is not <pre>
tag, but I don't know how to reproduce that result without that tag.
How can I do that? Here is my code
echo '<pre>';
print_r($array);
echo '</pre>';
EDIT: echo json_encode($array);
will output a non-formatted text, just a line.
` there's http://php.net/manual/en/function.nl2br.php – Ultimater Dec 13 '15 at 23:16