PHP Classes

PHP Naming Convention Converter: Convert names between different conventions

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 119 All time: 9,485 This week: 326Up
Version Licenses PHP version Categories
naming-converter 1.0.0BSD License, Free...5PHP 5, Text processing
Description 

Author

This class can convert names between different conventions.

It provides several functions that can take a strings with names with multiple words using certain conventions to separate the words, and converts the strings to use other conventions.

Currently it can convert word separations between:

- camel case to underscores
- underscores to camel case
- underscores to Pascal case
- camel case to separated words
- camel case to upper case first word character
- camel case to upper case first name character

Picture of Khoa Nguyen
  Performance   Level  
Name: Khoa Nguyen <contact>
Classes: 1 package by
Country: Viet Nam Viet Nam
Age: 37
All time rank: 435427 in Viet Nam Viet Nam
Week rank: 312 Up4 in Viet Nam Viet Nam Up

Example

require_once 'NamingConventionConverter.php';
echo NamingConventionConverter::underscores2Camel('with_underscores'); // withUnderscores
echo NamingConventionConverter::camel2Underscores('camelCased'); // camel_cased
echo NamingConventionConverter::camel2Words('camelCased'); // camel Cased
echo NamingConventionConverter::camel2Ucwords('camelCased'); // Camel Cased
echo NamingConventionConverter::camel2Ucfirst('camelCased'); // Camel cased


  Files folder image Files  
File Role Description
Accessible without login Plain text file demo.php Example demo
Plain text file NamingConventionConverter.php Class source code class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:119
This week:0
All time:9,485
This week:326Up