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!