I want to parse "true" from xml below with php
<?xml version="1.0"?>
<sparql xmlns="http://ift.tt/1H8JDsT"xmlns:xsi="http://ift.tt/ra1lAU"xsi:schemaLocation="http://ift.tt/1JDpQzH">
<head>
<link href="example2.rq" />
</head>
<boolean>true</boolean>
</sparql>
exactly the result is:
true
i try to use:
$curl_response = curl_exec($curly);
curl_close($curly);
$result = new SimpleXMLElement($curl_response);
print_r($result);
echo $result->sparql->boolean;
but it can't work. Is there any way to get the "true" from that xml and parse it to new variable?
No comments:
Post a Comment