It is interesting to know that there are so many Functions that will help you in your next projects I found it from this source https://www.youtube.com/watch?v=_XS8kxTuq_Q and wanted to share this wonderful information with you // echo ucfirst('john'); // Result: "John" echo lcfirst('John'); // Result: "john" echo strtolower('John Smith'); // Result: "john smith" echo strtoupper('john smith'); // Result: "JOHN SMITH" echo ucwords('john smith'); // Result: "John Smith" // Laravel helpers: echo Str::camel('variable_name'); // Result: "variableName" echo Str::snake('variableName'); // Result: "variable_name" echo Str::kebab('variableName'); // Result: "variable-name" echo Str::slug('Some article title'); // Result: "some-article-title"
'|'; // Result: "With spaces " echo '|'. rtrim(' With spaces '). '|'; // Result: " With spaces" echo substr(' With spaces ', 1, 4); // Result: " With" echo substr_replace(' With spaces ', 'Without', 1, 4); // Result: " Without spaces " echo substr_count('with spaces and with more', 'with'); //Result: 2