vikaspa Posted March 31, 2008 Share Posted March 31, 2008 I had made provision to upload file in jpg, excel, pdf or word format The file is uploaded on server. It was assumed that the file uploaded will be in jpg format and I can display the file in jpg, png, gif format So to display file in pdf, word or excel Now i need to check the file format and display it according (as per file format ) Please please help me to display the uploaded file in different format I will be really greatful .... Thanks in advance Quote Link to comment Share on other sites More sharing options...
getshahidonline Posted March 31, 2008 Share Posted March 31, 2008 <?php $image_jpg = array(); $image_png = array(); $image_gif = array(); $myimage = array('first.jpg','second.png','third.gif','fourth.jpg','fifth.png','sixth.gif'); for($i=0; $i<6; $i++) { $ext = substr($myimage[$i],-3); if($ext == 'jpg') { array_push($image_jpg ,$myimage[$i]); } elseif($ext == 'png') { array_push($image_png ,$myimage[$i]); } else { array_push($image_gif ,$myimage[$i]); } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.