What is camel case?

PHP: What is camel case?

Camel case is where you write words/phrases so that each word begins with a capital letter (but lower case for the rest of the word), and there is no space (or other punctuation) between words. It is often used for function/method names, or variables. For example showBlogPosts().

(Note: often the first character will be lower case for things like method names and parameters. The first character will often be upper case for class names (e.g. class BlogController {...}.

Other alternatives include kebab-case (all lowercase, separated by a hyphen -). Also known as lisp-case or spinal-case.

There is also Train-Case (lowercase, but first letter uppercase, separated by hyphens).

webdevetc profile pic
webdevetc

I am a 29 year old backend web developer from London, mostly focusing on PHP and Laravel lately. This (webdevetc.com) is my blog where I write about some web development topics (PHP, Laravel, Javascript, and some server stuff). contact me here.



More...


Comments and discussion about What is camel case?

Found this interesting? Maybe you want to read some more in this series?

Or see other topics in the PHP language

Or see other languages/frameworks:
PHP Laravel Composer Apache CentOS and Linux Stuff WordPress General Webdev and Programming Stuff JavaScript
Or see random questions

How can you check if a variable is alphanum (alphanumeric, letters and numbers only) in PHP?

What is the difference between reference and primitive data types types in Javascript?

How to have a whitelist of IP addresses that can access files in .htaccess

How to set custom HTTP headers in Apache (by editing .htaccess)

PHP Date commonly used formats

What is the difference between empty(), isset(), != null, is_null() in PHP

How to hide the server signature (hide Apache info) from HTTP headers with .htaccess

How to get table column names from a database table in Eloquent?

A list of operators on Eloquent's where() method

How to get a route to directly show a view?