PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Osama Salama   PHP YouTube API Class   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: example 1
Class: PHP YouTube API Class
Search or retrieve YouTube video information
Author: By
Last change:
Date: 8 years ago
Size: 681 bytes
 

Contents

Class file image Download
<?php

/*

Search in YouTube using Api . v3

*/

require_once "YouTube.php";
$Video = new YouTube();
 
$result = $Video->Search('phpclasses');

echo
"<table width=\"300px\">
<th>VideoID</th>
<th>Title</th>
<th>description</th>
<th>thumbnails</th>
"
;
     if(
is_array($result)){

  for(
$i=0;$i<count($result['items']);$i++){
 
?>
<tr>
<td><?php echo $result['items'][$i]['id']['videoId'];?></td>
<td><?php echo $result['items'][$i]['snippet']['title'];?></td>
<td><?php echo $result['items'][$i]['snippet']['description'];?></td>
<td><img src="<?php echo $result['items'][$i]['snippet']['thumbnails']['default']['url'];?>"/></td>
</tr>
 
<?php


    
}
echo
"</table>";
      }