Hi Dear All
I have 1000s of JPGs Images.
Names like S-KHI-1233
Now I need To rename all the images and new name should be last 4 numeric digits like 1233.
For all 1000 JPGs I want to do this.
if image name is S-KHI-1964 then new name should be 1964
and if name S-LAK-1854 then new name should be 1854.
ayesha789
7
Posting Pro in Training
Recommended Answers
Jump to PostI've used this: http://www.1-4a.com/rename/
But you can just search google for file renamer if you want another one.
Jump to PostUse regular expression:
eg:
$name = 'S-KHI-1233'; $name = preg_replace("/[^0-9]/", '', $name);
Jump to PostBut I have these JPGs in the folder name IMAGES.
How I can apply this code?PHP has numerous ways to traverse directories. Probably the simplest is the glob() function. (PHP4.3+)
…
All 11 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
ayesha789
7
Posting Pro in Training
muralibobby2015
17
Posting Pro
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
ayesha789
7
Posting Pro in Training
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
ayesha789
7
Posting Pro in Training
ayesha789
7
Posting Pro in Training
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
ayesha789
7
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.