note 60941 added to function.ereg-replace

From: Date: Fri, 20 Jan 2006 19:43:33 +0000
Subject: note 60941 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-102175@lists.php.net to get a copy of this message
I've updated the function a little that was posted below. I use it to make database field names readable when making a header row. I needed it to quit putting a space in "GPA" and to put a space in between numbers and letters. <?php /** * Converts "fieldcontainingGPAInMyDatabaseFrom2005" * To "Field Containing GPA In My Database From 2005" */ function innerCapsToReadableText($text) { $text = ereg_replace("([A-Z]) ", "\\1",ucwords(strtolower(ereg_replace("[A-Z]"," \\0",$text)))); return ereg_replace("([A-Za-z])([0-9])", "\\1 \\2", $text); } ?> ---- Server IP: 64.71.164.2 Probable Submitter: 66.0.71.9 ---- Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60941 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60941&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60941&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102175) next »