Jump to content

foreach one line problem


unistake

Recommended Posts

Hi all,

 

I have a lot of images in a directory called image1.jpg image1_thumb.jpg image2.jpg etc..

 

When I use this code

foreach (glob('./aircraft/' . $_GET['reg'] . '*.jpg') as $file)

 

The foreach statement gets the _thumb.jpg images - I am trying to just get the images without _thumb.jpg at the end.

 

What is wrong with it? I am guessing it is the *.jpg but I have tried taking that out and the script then does not work.

 

Thanks for your help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.