hey. I need to make file names be consisted of only numbers and letters. Like if there is an image named 'img*1L%^_ove>ly.jpg' it will become 'img1Lovely.jpg' . Only digits and letters (btw letters meaning even if not english letters). Thanks a lot. I went through php.net, failed finding sth like this. Maybe you profies know) or can advise me easy way to do it.
kracko
0
Light Poster
Recommended Answers
Jump to Postwithout regex, the alternative is to list ALL the characters you don't want and use str_replace() to remove them - ex assuming you do not want any of the following:
# _ -then use:
$str=str_replace('#_-','',$str); echo $str;
but it is easier if you list only …
All 4 Replies
Reply to this topic
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.