Altax\Util\Str::studly PHP Method

studly() public static method

Convert a value to studly caps case.
public static studly ( string $value ) : string
$value string
return string
    public static function studly($value)
    {
        $value = ucwords(str_replace(array('-', '_'), ' ', $value));
        return str_replace(' ', '', $value);
    }

Usage Example

Example #1
0
 public function testStudly()
 {
     $this->assertEquals("AaaBbbCcc", Str::studly("aaa_bbb_ccc"));
 }