Haaskis
10-24-2009, 11:51 AM
Heya,
So, I have this little problem - replacing special things (can't remember the correct word right now) from a string. This is to show links in more understandable way, example:
"this_file_is_awesome.php", translating to "this file is awesome".
This far I have gone around it with this little code:
$filec1 = str_replace(".php", "", $file1);
$filec2 = str_replace("axaxa", "ä", $filec1);
$filec3 = str_replace("oxoxo", "ö", $filec2);
$filec4 = str_replace("_", " ", $filec3);
//Show string without garbage
echo $filec4;
But Im afraid it is quite uneffective way, is there a better way to do this? Right now my current code doesn't even have half of what it should, and having 25 different valuables would be like, bad?
I dont want ready code, but someone showing direction is what I'm looking for ;).
So, I have this little problem - replacing special things (can't remember the correct word right now) from a string. This is to show links in more understandable way, example:
"this_file_is_awesome.php", translating to "this file is awesome".
This far I have gone around it with this little code:
$filec1 = str_replace(".php", "", $file1);
$filec2 = str_replace("axaxa", "ä", $filec1);
$filec3 = str_replace("oxoxo", "ö", $filec2);
$filec4 = str_replace("_", " ", $filec3);
//Show string without garbage
echo $filec4;
But Im afraid it is quite uneffective way, is there a better way to do this? Right now my current code doesn't even have half of what it should, and having 25 different valuables would be like, bad?
I dont want ready code, but someone showing direction is what I'm looking for ;).