Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php convert words with spaces to camelcase

public static function camelCase($str, array $noStrip = [])
{
        // non-alpha and non-numeric characters become spaces
        $str = preg_replace('/[^a-z0-9' . implode("", $noStrip) . ']+/i', ' ', $str);
        $str = trim($str);
        // uppercase the first character of each word
        $str = ucwords($str);
        $str = str_replace(" ", "", $str);
        $str = lcfirst($str);

        return $str;
}
Comment

php function to convert string to camelcase

echo ucwords("hello world");
Comment

PREVIOUS NEXT
Code Example
Php :: Wordpress disable plugin or theme installation 
Php :: wordpress user enumeration 
Php :: E: Unable to locate package php7.2-mbstring 
Php :: wordpress stop redirect to https 
Php :: get option field acf 
Php :: laravel rename column name 
Php :: composer create project laravel 7 
Php :: laravel make migration controller resource mcr 
Php :: logout php 
Php :: convert to int laravel 
Php :: hash a password php 
Php :: php get method name 
Php :: localhost install new plugin ftp wp 
Php :: composer memory limit 
Php :: php clear output 
Php :: php get uploaded file extension 
Php :: convert date to reverse date in php 
Php :: how to start a session 
Php :: php sort multidimensional array 
Php :: transaction in laravel 
Php :: increament single column laravel current value + 1 
Php :: wordpress order by 
Php :: print query in laravel 
Php :: php Access-Control-Allow-Origin 
Php :: php check if string email 
Php :: php round decimal 
Php :: wordpress get current category slug 
Php :: laravel makehidden 
Php :: symfony exclude class from autowiring 
Php :: get all post meta 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =