Jump to content

[SOLVED] Finding highest number


Timma

Recommended Posts

if you glob() the folder... you can easily grab all the files into an array...

 

$files=glob('path/file*.png');

natsort($files);

$high=$files[count($files)-1];

 

 

 

 

chigley - my way's faster ;-)

Link to comment
Share on other sites

Error Time.

I used the glob method, but that only returns the number 9, when I was testing with 16 files.

 

Secondly, I need a way to remove the "images/file .png", but leave the number. So possibly just counting the amount of files in the folder and then finding the highest. Obviously I don't know how to do this or I wouldn't be saying it  :D

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.