Hi all,
I've got a code that searches a string (an embed script) and strips it down to the youtube video link.
$encoded = strchr("$encoded","http://www.you");
$encoded = strrev($encoded);
$encoded = strrchr("$encoded","&");
$encoded = strrev($encoded);
$encoded = str_replace("-nocookie","","$encoded");
$encoded = str_replace("&","",$encoded);
Might be a bit "busy" .. but I'm a rookie, still that works well enough.
My problem is that it searches for http://www.you - but if it is not a youtube video it will returns blank (obviously).
So my question is, how do I go about stopping it from making my string nothing when it's not a youtube vid?
I have tried to play around with if statements, but I'm bit clueless .. any help really appreciated!!
Thanks in anticipation