samedi 22 septembre 2018

php random with foreach function

Hey i have problem how to randomize get only one code to page. Maybe later can be more codes like 10 and i need only one code use to website randomize after restart page or if can for all 10seconds delay to randomize

    foreach($videoList->items as $item){
        if(isset($item->snippet)){
            echo '<img src="'.$item->snippet->thumbnails->default->url.'"/><br /><a href="'.$item->snippet->customUrl.'">'.$item->snippet->title.'</a>';
        }

    }
    foreach($videoChannel->items as $item){
        if(isset($item->snippet)){
            echo '<img src="'.$item->snippet->thumbnails->default->url.'"/><br /><a href="'.$item->snippet->customUrl.'">'.$item->snippet->title.'</a>';
        }

    }




Aucun commentaire:

Enregistrer un commentaire