php - find the <time> tag, explode the date inside, then echo it -


i trying date <time> tag

$explode = explode( '<time class="abs">', file_get_contents($url))[1]; $get_date = explode("</time>" , $explode); echo date_format(date_create($get_date[0]),"y/m/d"); 

the echo shows date there error

notice: undefined offset: 1 

when var_dump, shows there nothing in array why echo correct date..?


Comments