I must be doing something stupid here. I have this php file:
$arr = array("result" => "dasdasds;bks fjsdgjdklsds j&*", "text" =>"23 + 2 =   ?");
echo json_encode($arr);
And I call it in my js file:
/*
* PHP array to json
*/
$("#jsonform").submit(function(e){
$.ajax({
url:"/phparraytojson/Helper.php",
success: function(data){
console.log(data.result) //undefined
console.log(data); //{"result":"dasdasds;bks fjsdgjdklsds j&*","text":"23 + 2 =   ?"}
}
})
e.preventDefault();
})
header('Content-type: application/json');