mlse
12-01-2006, 12:25 PM
Hi all,
I want to convert a string like "this_is_my_string" to "thisIsMyString".
The closest I've got is:
$mystr = "this_is_my_string";
print(preg_replace('{\_([a-z])}', 'strtoupper("$1")', $mystr));
Which doesn't quite work! (try it). I need to get preg_replace to recognise the call to strtoupper, or some equivalent method.
Any ideas?
TIA,
Mike.
I want to convert a string like "this_is_my_string" to "thisIsMyString".
The closest I've got is:
$mystr = "this_is_my_string";
print(preg_replace('{\_([a-z])}', 'strtoupper("$1")', $mystr));
Which doesn't quite work! (try it). I need to get preg_replace to recognise the call to strtoupper, or some equivalent method.
Any ideas?
TIA,
Mike.