Forum Moderators: coopster
For example: in the USERS table, I have a field called firstName. I want to know I could split firstName into two parts ("first" and "Name") so I can work with it on my tables. I would use those field names for my table headers throughout my site. I was wondering if this is possible.
Once "firstName" is converted into "first Name", I can easily set "first" to be uppercase as well ("First") and the final result would be "First Name", just how I wanted.
Thanks!
$str = 'lastName';
#
$pattern = "/(.)([A-Z])/";
$replacement = "\\1 \\2";
echo [url=http://www.php.net/ucfirst]ucfirst[/url]([url=http://www.php.net/preg-replace]preg_replace[/url]($pattern, $replacement, $str));