camel.php
Table of Contents
Functions
- camel() : string
- Converts a string to camelCase format.
Functions
camel()
Converts a string to camelCase format.
camel(string|null $source[, array<string|int, mixed> $separators = ["_", "-", "/"] ]) : string
This function transforms the input string by replacing specified separator characters with spaces, capitalizing each word, removing spaces, and then lowercasing the first character.
Parameters
- $source : string|null
-
The input string to convert to camelCase. If null or empty, returns an empty string.
- $separators : array<string|int, mixed> = ["_", "-", "/"]
-
An array of separator characters to be replaced by spaces before conversion. Defaults to ["_", "-", "/"].
Tags
Return values
string —The camelCase representation of the input string.