Page 1 of 1

Captialising letters.

Posted: Thu Aug 07, 2003 10:38 pm
by evilcoder
Hey guys, this is weird, i used to know how to do this, but i cant remember.

i have http strings like this: /?i8=hello_there

now, that calls the file hello_there.php

however i have a "Where am i:" text bar..

When that address gets called i want the text bar to say: Where am i: Hello There.

I know how to remove the _ and replace it with   with ereg_replace, but how to i;
a: Capitalise the First letter of the variable
b: Capitalise the first letter after the _

Thanks guys

Posted: Fri Aug 08, 2003 12:46 am
by qartis
$string = "hello_world";
$string = str_replace("_"," ",$string);
$string = ucwords($string);

Posted: Fri Aug 08, 2003 2:55 am
by evilcoder
thank mate.. works the charm