Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi could you help me please to remove "-" form the directory this code returns. I have index.php in "how-it-works" folder but want it to return "how it works" instead of "how-it-works" is there a ways to remove "-"
Thanks
the code i use

echo '<title>'.basename(realpath('./')).'</title>';
?>
Posted

1 solution

 
Share this answer
 
Comments
Member 9739402 16-Apr-13 11:48am    
Hi could you fix it for me I am not very into PHP? Please
DinoRondelly 16-Apr-13 11:50am    
Fix it?

str_replace("-", "", YourPath);
Member 9739402 16-Apr-13 11:59am    
thanks for your reply could you please combine your code with mine please I don't know how to?
echo '<title>'.basename(realpath('./')).'</title>';

str_replace("-", "", YourPath);
DinoRondelly 16-Apr-13 12:01pm    
Try something like this, you might have to play with it a little bit, but basically you the last argument in the str_replace function is the string.

str_replace("-", "", basename(realpath('./')));
Member 9739402 16-Apr-13 12:23pm    
how to accept you solution as the best?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900