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
https://forums.phpfreaks.com/topic/218320-foreach-one-line-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.