PHP Classes

File: example2.php

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


Class file image Download


get video information and duration from YouTube using Api . v3 By video Id


require_once "YouTube.php";
$Video = new YouTube();
//UEo-Vm1O0fk >>>video id
$result = $Video->VideoInfo('UEo-Vm1O0fk');

"<table width=\"300px\">
<td><?php echo $result['id'];?></td>
<td><?php echo $result['title'];?></td>
<td><?php echo $result['description'];?></td>
<td><img src="<?php echo $result['thumb'];?>"/></td>
<td><?php echo $result['duration'];?></td>
echo "</table>";