I would like to know how to parse the text of a file name so it keeps the extension.
so someimage.jpg would become .jpg. This is so I can change the file name but leave the extension.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
pathinfo()and pass thePATHINFO_EXTENSIONflag to get the file extension. You need to add the dot yourself as the function leaves it out: