Good all the time of day, gentlemen! Need advice php guru.
There is a tmp directory on the site, inside there are files that have known names (from where), but extensions are not written. The algorithm is this, we know the first part of the name - you need to find if there are files starting with this name, and if there is any, let's say it starts at f931992748863024fda1b647080e8ffa (I suspect that in the past it was session_id, but not the essence)
Tell me how to find all the files that start with the specified name? (there may be several, maybe 1, or maybe not). file_exists()
, unfortunately, requires an exact match. The second part of the files is usually _1.txt , _5.docx ... in this format, i.e. underscore, digit, period, and some extension. Would love to get an answer on php
ps to form an array about the contents of the directory, and then sort through it - I think it is not an option, because specifically in my catalog more than 10 thousand files. It will take a lot of time.
ls **/somefile*
- neoascetic