v2.5.2
Giriş yap

video&img ayırma

emmir2
262 defa görüntülendi

Merhaba upload sistemim var burda hem img hem de video eklenebiliyor veri çekim kısmında sorun yaşıyorum video eklendiğin de bunu nasıl tespit edebilirim aynı şekil de img ve video varken bunları nası ayırabilirim

Cevap yaz
Cevaplar (1)
emmir2
564 gün önce
$src=$row['File'];

        if (preg_match("/\.jpg$/i",$src)){

            echo "<img src='$src' height='200' width='200' alt='Image not Found'/>";

        }else{

             echo "<video width='200' height='200' autoplay controls> <source src='$src' type='video/mp4'> </video>";

        }