Please help with php coding problem

Posted by registercheaper, 03-06-2010, 01:43 AM
I have the following code for a video site. I need to have .mp4 file extension videos play in the same player is the .flv videos extension but I don't know how to edit this code below to resolve my problem. //print_r($a);exit; if(substr($a[url],-4,1)=='.') if(substr($a[url],-4,4)=='.flv') $not_flash_video=0; else $not_flash_video=1; elseif(is_numeric($a[url])) { $yahoo = true; $not_flash_video=1; } else $not_flash_video=0; ### use microsoft player if (preg_match('~rstp~i', $a[url], $match)) { $not_flash_video = true; } //echo "not_flash_video=".$not_flash_video;exit; //echo "$a[url]=".substr($a[url],-4,4);exit; $flashplayer=2; if($not_flash_video) { if ($yahoo === true) Can anyone help Thanks

Posted by SunShellHosting, 03-06-2010, 02:04 AM
Hello Your haven't posted the codes completely or it is in a bad shape so that I can understand it. Can you describe what does that variable meant ? or for what purpose they are used ?

Posted by registercheaper, 03-06-2010, 02:28 AM
Sorry. You can see the full code here http://corbilla.com/song.txt

Posted by Evzin, 03-06-2010, 11:13 AM
Try to replace '.flv' with '.mp4' in line 3

Posted by registercheaper, 03-06-2010, 02:21 PM
Thanks for your replay. If I replace line 3 with .mp4 the .flv files a have on my server will not play. I would like to have both extensions using the same player. Thanks for your help

Posted by Steve_Arm, 03-06-2010, 02:24 PM
Line 3 from above change to if(substr($a[url],-4,4)=='.flv' || substr($a[url],-4,4)=='.mp4')

Posted by Evzin, 03-06-2010, 02:25 PM
to have both extentions u could use OR condition there edit: Steve Arm was faster

Posted by registercheaper, 03-06-2010, 02:33 PM
Thats what I was looking for...Thanks alot to all!

Was this answer helpful?

 Print this Article

Also Read

Error handling in ASP.NET

Posted by Beach Musician, 09-08-2008, 11:49 AMI'm trying to help a colleague who wants to do...

FFmpeg install problem multiple methods

Posted by Calibaba, 07-16-2008, 10:42 PMTrying to install FFmpeg through this method:...

Has anyone Xperience with BOTH MCHost and Voxtreme?

Posted by cyberdao, 07-20-2002, 10:26 PMHas anyone (had) accounts with both MCHost and Voxtreme?...

Very slow MySQL Queries on better hardware

Posted by YYamagishi, 03-27-2008, 08:12 PMHi, I'm having a problem with a MySQL servers. I had:...

Looking for a Shell Script! :)

Posted by dwscenter, 01-14-2008, 01:25 AMFirst off I want to apologize if I posted this in the...