Bu benim php kodu:
<?php
if (array_key_exists("site", $_GET) && $_GET["site"] != "" )
{
$url = $_REQUEST['site'];
$url = " http://api.mywot.com/0.4/public_query2?target=";
$result= $url.urlencode($url);
$process = curl_init($result);
//init curl connection
curl_setopt($process, CURLOPT_HEADER, 0);
curl_setopt($process, CURLOPT_POST, 1);
curl_setopt($process, CURLOPT_RETURNTRANSFER,1);
curl_setopt($process,CURLOPT_CONNECTTIMEOUT,1);
$resp = curl_exec($process);
curl_close($process);
header('Content-Type: text/xml');
$xml = new SimpleXMLElement($resp);
}
?>
Varsayalım xml:
<?xml version="1.0" encoding="UTF-8"?>
<query target="example.com">
<application name="0" r="89" c="44"/>
<application name="1" r="89" c="46"/>
<application name="2" r="92" c="47"/>
<application name="4" r="93" c="48"/>
</query>
Xml bu tür dosya okumak için biliyorum
<Status>
<code>200</code>
<request>geocode</request>
</Status>
$status = (int) $xml->Status->code;
Yukarıdaki xml application
, nasıl belli olanları okuyabilirsiniz gibi etiketleri tekrarladı?