I need to convert a string in camel case to normal text, i.e.
"thisIsAString" to "this is a string"
using PHP and preg_replace but I'm stumped, any ideas?
"thisIsAString" to "this is a string"
using PHP and preg_replace but I'm stumped, any ideas?
PHP:
$text = "thisIsAString";
$text = unCamelize($text);
function unCamelize($text)
{
$pattern = '([A-Z])';
$replace = '$1';
$text = strtolower(preg_replace($pattern, $replace, $text));
return $text;
}