etrader Posted December 28, 2010 Share Posted December 28, 2010 I display file names by this simple code echo $path_parts['filename'], "\n"; 1. How can I replace some characters, e.g. replacing "_" with " " (space)? 2. How can I capitalize the output words? Link to comment https://forums.phpfreaks.com/topic/222818-replace-characters-in-echo/ Share on other sites More sharing options...
Zurev Posted December 28, 2010 Share Posted December 28, 2010 echo ucwords(str_replace("_", " ", $path_parts['filename'], "\n))"; http://www.php.net/manual/en/function.ucwords.php http://www.php.net/manual/en/function.str-replace.php Think I messed up the quotes, though you get the idea. Link to comment https://forums.phpfreaks.com/topic/222818-replace-characters-in-echo/#findComment-1152110 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.