I have two field in database “FileName” and “UrlFileName”,so I sanitize “FileName” from Invalid character to have a new file Name for example “FinaleFileName”,so my question is I need a simple code or function to change the name of file in URL too before stored my both field in DB,for example :
$FileName = "NaMeoFImagE-10.jpeg"
$UrlFileName = "uploads/pics/NaMeoFImagE-10.jpeg"
....
//I had created a function to remove or replace a invalid character //Ok
$FinaleFileName= nameofimage-10.jpeg
.....
A function to replace a File name in URL // Not OK
$FinaleUrlFileName = "uploads/pics/nameofimage-10.jpeg"// Im looking for this result
Any Idea?
I’m not sure I understand what you’re asking, but based on your test case, I think you’re looking for
strtolower.