You are here

public static function EasyRdf_Utils::camelise in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/easyrdf/easyrdf/lib/EasyRdf/Utils.php \EasyRdf_Utils::camelise()

Convert a string into CamelCase

A capital letter is inserted for any non-letter (including userscore). For example: 'hello world' becomes HelloWorld 'rss-tag-soup' becomes RssTagSoup 'FOO//BAR' becomes FooBar

Parameters

string The input string:

Return value

string The input string converted to CamelCase

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Utils.php, line 61

Class

EasyRdf_Utils
Class containing static utility functions

Code

public static function camelise($str) {
  $cc = '';
  foreach (preg_split('/[\\W_]+/', $str) as $part) {
    $cc .= ucfirst(strtolower($part));
  }
  return $cc;
}