note 78040 added to function.str-split
| From: | Sam at osu1 dot php dot net | Date: | Tue, 25 Sep 2007 08:24:25 +0000 |
| Subject: | note 78040 added to function.str-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130775@lists.php.net to get a copy of this message | ||
A good way to use this method to convert CamelCase text into nice text would be-
<?php
/**
Returns a formatted string based on camel case.
e.g. "CamelCase" -> "Camel Case".
*/
function FormatCamelCase( $string ) {
$output = "";
foreach( str_split( $string ) as $char ) {
strtoupper( $char ) == $char and $output and $output .= " ";
$output .= $char;
}
return $output;
}
?>
----
Server IP: 83.137.20.107
Probable Submitter: 62.58.16.165
----
Manual Page -- http://www.php.net/manual/en/function.str-split.php
Edit -- https://master.php.net/note/edit/78040
Del: integrated -- https://master.php.net/note/delete/78040/integrated
Del: useless -- https://master.php.net/note/delete/78040/useless
Del: bad code -- https://master.php.net/note/delete/78040/bad+code
Del: spam -- https://master.php.net/note/delete/78040/spam
Del: non-english -- https://master.php.net/note/delete/78040/non-english
Del: in docs -- https://master.php.net/note/delete/78040/in+docs
Del: other reasons-- https://master.php.net/note/delete/78040
Reject -- https://master.php.net/note/reject/78040
Search -- https://master.php.net/manage/user-notes.php