Finally i get some output out of PHP instead of just the word "array". This took me a day, AAAAHHHH.
(see here for the solution)
So this is the return value from a XMLHTTP request (to PHP), via a callback in JS. I got it with print_r
in PHP.
I post a snippet of the results here. My new question:
- what is this data structure made of?
how to get elements out of this structure, such as CourseID (in JS)?
[0] => Parse\ParseObject Object ( [serverData:protected] => Array ( [CourseID] => DEMO2 [EndDate] => DateTime Object ( [date] => 2017-03-31 10:26:00.000000 [timezone_type] => 2 [timezone] => Z ) [InfoTitle1] => Welcome [InfoText1] => Welcome to your course, called "sense & sales". [Admin] => Remco@Demo1 )
My PHP code is
function getGroups(){
$query = new ParseQuery("CourseInfo");
$query->equalTo("Admin", "Remco@Demo1");
$results = $query->find();
// echo $results // this lead to the string "array"
//print_r($results); // this leads to the complicated array
//echo "<script>\r\n var phpOutput = " . json_encode($results) . ";\r\n console.log(phpOutput);\r\n</script>";
// this leads to [{},{}];
}