mercredi 30 septembre 2015

if preg_match and elseif wont work

$embedcode=""
if($embedcode==""){
$file="some-url-here";
if ( preg_match("/vbox/i",$file) ) { 
preg_match_all('#vbox-(.*?)-end#smi',$file,$gell);
$gelll= $gell[1][0];
echo 'embed code from vbox';
} elseif ( preg_match("/youtube/i",$file) ) { 

echo "embed code from youtube";

}elseif ( preg_match("/facebook/i",$file) ) { 
echo "embed code from facebook";
}else {
echo "my player";
}

Gives:

Parse error: syntax error, unexpected T_ELSEIF in from the first elseif

this is a small php code to get a embed url

but dont work for me

Aucun commentaire:

Enregistrer un commentaire