Return to Snippet

Revision: 54630
at January 5, 2012 08:42 by leandroperes


Initial Code
<?php
/*

Simple Class capture ID Youtube 
Leandro Peres - 04/01/0212

*/

class Youtube {
	private $url;

	function PegaID ($url = null) {
	$url = substr($url, strpos($url, "v="));
	$this->url = str_replace("v=", "", $url);
	echo $this->url;
	}
}

$Youtube = new Youtube();
$ID = $Youtube->PegaID("http://www.youtube.com/watch?v=RmeXANd7c8I");
?>

Initial URL


Initial Description
Simple class to retrieve an ID using a URL of the Youtube

Initial Title
Simple class to retrieve an ID using a URL of the Youtube

Initial Tags
class, simple

Initial Language
PHP