|
That should work, it might be a little overkill with all the valid character checking though :P
You could also:
$arr = explode('=', $youTubeURL);
and validate just the portion you want:
$linkCode = $arr[count($arr)-1];
While that wouldn't work with the last case you posted you could just do a:
$youTubeUrl = str_replace('/', '=', $youTubeUrl);
before hand since you don't care what the domain is anyway... It would definitely be much faster than using regex, parsing wise :P
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com
|