<?php
$data = "This is some data
It has some new lines in it
Look, there's some more";
var_dump($data);
$json = json_encode($data);
var_dump($json);
var_dump(json_decode($json));
string(70) "This is some data
It has some new lines in it
Look, there's some more"
string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more""
string(70) "This is some data
It has some new lines in it
Look, there's some more"
Output for 5.2.1
string(70) "This is some data
It has some new lines in it
Look, there's some more"
string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more""
string(73) "This is some data\nIt has some new lines in it\n\nLook, there's some more"
Output for 5.2.0
string(70) "This is some data
It has some new lines in it
Look, there's some more"
string(75) ""This is some data\nIt has some new lines in it\n\nLook, there's some more""
NULL
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6
string(70) "This is some data
It has some new lines in it
Look, there's some more"
Fatal error: Call to undefined function json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.4.5 - 4.4.9
string(70) "This is some data
It has some new lines in it
Look, there's some more"
Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
string(70) "This is some data
It has some new lines in it
Look, there's some more"
Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(70) "This is some data
It has some new lines in it
Look, there's some more"
Fatal error: Call to undefined function: json_encode() in /in/k05be on line 9