- simplexml_load_string: documentation ( source)
<?php
$string = <<<XML
<programme channel="cnn.info" start="20131027060000" stop="20131027061500">
<title>hello CONTENT</title>
<premiere/></programme>
XML;
$xml = simplexml_load_string($string);
$start = $xml->attributes()->start;
$stop = $xml->attributes()->stop;
$title = $xml->title;
echo "Title: " . $title . "\n";
$datetime1 = new DateTime($start);
$datetime2 = new DateTime($stop);
$interval = $datetime1->diff($datetime2);
echo $interval->format('Time:left %i minutes');