i have a code, it's getting data but when it gets nothing i want it to return something.
$upcoming = simplexml_load_file('http://api.website.com');
foreach($upcoming->trailer as $x => $updates) {
$content.= '<center><br><span> ' . $updates->embed . '</span></center>';
}
This is the code. It's getting data but when it got nothing, i would like it to say NO Videos.
How can i do that? I tried strlen() but i couldn't applied it.
I tried strpos but it didn't work either.
simplexml_load_filefails it returnsFALSEif ($upcoming === FALSE) $content .= 'no videos';?