Function to get a php array containing the received json data. Minor changes on debug function.