Hello all,
I'm trying to create an image upload page and need to rename the uploaded file if a file with the same name currently exists. I want to use an incremental number system but don't know the proper regular expression to find the incremented portion of the file name so I can change it.
After stripping the file extension when the file uploads I might end up with a file name like:
my_image_34_name_03
I need to be able to identify an UNDERSCORE character followed by EXACTLY two NUMBERS at the very END of a string.
This would recognize "03" and would NOT recognize "34".
I would then use the following to increment the file name
$name = my_image_34_name_03;
$name++;
Can anyone help me with the syntax to spot "00" - "99" at the END of a string?
Thank you!
Peter