cURL returning XML or JSON cURL returning XML or JSON curl curl

cURL returning XML or JSON


just encode it as you want, and echo it to the page. your $data= will contain the echoed contents. Personal preference has been to use JSON since it's so easy to throw around. as in

//Bunch of DB stuff..$row=mysql_fetch_however_you_handle_it();echo json_encode($row);//on your receiving end, that just did the cURL send,$row=json_decode($data,true);//decode the JSON straight into an array...


When you pull the information from the database and process it in processXML.php, add the results to an array, use json_encode() to convert the array to JSON, and then echo the results to the page.


Just echo out the data you need to send back to the form, in your format of choice, and fetch that response in thepalreg.php.