I’m trying to replace dashes and the ‘.php’ extension on a string, for example:
Original String:
my-awesome-link.php
Resulting String:
My Awesome Link
Any help greatly appreciated!
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.
You can use
str_replaceto get rid of both ‘-‘ and ‘.php’, thenUCWordsto go from ‘my awesome link’ to ‘My Awesome Link’.