Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6755973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:28:02+00:00 2026-05-26T13:28:02+00:00

I finally managed to get the PHP script below to work…but then I found

  • 0

I finally managed to get the PHP script below to work…but then I found that I actually can’t call vimeo video links because they do not have a file extension eg: http://vimeo.com/12345678

The script I’m using loads a slideshow if the file extension is an image file, if it’s a flash file it loads the swf, and my idea was to have a vimeo iframe load if the file extension was for example .mov. All of the filenames are in the work.txt file.

I am so confused about what to do! Does anyone have any ideas of what I could add so that this script can load vimeo videos?

      <?php
$photos=file("work.txt");
$img = array('jpg', 'png', 'gif');
$vid = array('mp4', 'mov', 'mpg', 'flv');
$flash = array('swf');
foreach($photos as $image){
$item=explode("|",$image);
if($item[0]==$fields[0]){
$photo=trim($item[1]);
$ext = explode(".", $photo);

if(in_array($ext[1], $img))
{ echo "<div id='slider-wrapper'><div id='slider' class='nivoSlider'><img src='images/work/$photo' alt='' /></div></div>"; }


elseif(in_array($ext[1], $vid))
{ echo "<iframe src='http://player.vimeo.com/video/$photo' width='900' height='500' frameborder='0' webkitAllowFullScreen allowFullScreen></iframe>"; }


elseif(in_array($ext[1], $flash))       
{ echo "<object id='myId' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='900' height='500'><param name='movie' value='$photo' />
            <!--[if !IE]>-->
            <object type='application/x-shockwave-flash' data='$photo' width='900' height='500'>
            <!--<![endif]-->
            <div>
            <h1>Alternative content</h1>
            <p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>
            </div>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>"; }

  }
}
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:28:02+00:00Added an answer on May 26, 2026 at 1:28 pm

    You could use the strpos function on the URL.

    eg:

    elseif(strpos($image, 'vimeo.com') !== false)
    

    That will search your string for the text ‘vimeo.com’.

    I’m assuming here that $image is the full URL. But it might be $item, I can’t really tell from the code you have provided

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I finally managed to get my script to login to a website and
I have finally managed to get javan-whenever gem working on my site5 server, and
I finally managed to get an object out of an AsyncTask (DogAsyncTask) with an
Right, after much struggle I finally managed to get a sort of shared folder
Now I have finally managed to create a fullscreen window via http://cocoadevcentral.com/articles/000028.php Brilliant tutorial.
I have finally managed to get core data working and beginning to understand it.
I've finally managed to get Jetty7 running as a service in Debian. Still, I'm
I've finally managed to get a handle on loading information using Silverlight, ADO.NET Entities,
I have managed finally to get Solr working, with the help of all you
I've managed to get my thread running and stopping safely but what I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.