- substr: documentation ( source)
- file_get_contents: documentation ( source)
- date: documentation ( source)
<?php
$response = file_get_contents("https://sitehawk.fogbugz.com/api.asp?token=uhmenccs8r3jpdku5jnihqfu0g4ua1&cmd=listFixFors&ixProject=4");
$xml = new DOMDocument();
$xml->loadXML($response);
//$thexml = $xml->getElementsByTagName('area');
$milestone = $xml->getElementsByTagName('fixfor');
$counter = 0;
foreach($milestone as $mile){
$counter++;
}
$i = 0;
foreach($milestone as $mile){
$idFixfor = $mile->getElementsByTagName('ixFixFor');
$sFixfor = $mile->getElementsByTagName('sFixFor');
$sFixfordt = $mile->getElementsByTagName('dt');
if($i != $counter-1)
{
echo $idFixfor->item(0)->nodeValue . '/' . $sFixfor->item(0)->nodeValue . ': ' . date( substr($sFixfordt->item(0)->nodeValue, 0, 10)) . ',';
}
else
{
echo $idFixfor->item(0)->nodeValue . '/' . $sFixfor->item(0)->nodeValue . ': ' . date( substr($sFixfordt->item(0)->nodeValue, 0, 10))->format('m-d-Y');
}
$i++;
}