I have to get text between specific span class store in database.
I have tried it using DOM() , below is the code:
<?php

ini_set( "display_errors", 0); //warning not to display
$homepage = file_get_contents('http://justdial.com/Mumbai/Restaurants/ct-304085');

$xml = '<span class="jcn">Details i want to get</span>';
$dom = new DOMDocument;
$dom->loadHTML($homepage);
$spans = $dom->getElementsByTagName('span');


echo $span;

foreach ($spans as $span) {

echo strip_tags($span->nodeValue), PHP_EOL;
}

?>

I have to get all the span class="jcn" values inserted into my database. But not geting the proper output.
Please help me out of this.
Thanx in advance.