I make jQuery Ajax request which return output in XML format.
i want to access this XML in PHP to Process on data.
Below is sample of my code...
getTime.php File
<?php
header("Content-type: text/xml");
echo '<Dates>';
echo '<Now ';
echo 'val="' . date("h:m:s") . '" ';
echo '/>';
echo '</Dates>';
//echo date("h:m:s");
?>
index.php File
jQuery(document).ready(function(e) {
$('#btnTime').click(function(){
getData("GetTime.php");
});
});
function getData(strUrl)
{
$.ajax({
type: "POST",
url: strUrl,
dataType: "xml",
success: function(output){
// I want to Retrieve this XML Object (output) to PHP
}
});
}
How can I access XML outputed by jQuery in PHP?
Please help me..
outputrefers to the data returned by the ajax request... did you try itoutputitself a XMLDocument object.