public static function isUnderscoreName($string)
    {
        // If there are space in the name, it can't be valid.
        if (strpos($string, ' ') !== false) {
            return false;
        }

        if ($string !== strtolower($string)) {
            return false;
        }

        $validName = true;
        $nameBits  = explode('_', $string);

        foreach ($nameBits as $bit) {
            if ($bit === '') {
                continue;
            }

            if ($bit{0} !== strtolower($bit{0})) {
                $validName = false;
                break;
            }
        }

        return $validName;

    }
public static function isUnderscoreName($string)
    {
        // If there are space in the name, it can't be valid.
        if (strpos($string, ' ') !== false) {
            return false;
        }

        if ($string !== strtolower($string)) {
            return false;
        }

        $validName = true;
        $nameBits  = explode('_', $string);

        foreach ($nameBits as $bit) {
            if ($bit === '') {
                continue;
            }

            if ($bit{0} !== strtolower($bit{0})) {
                $validName = false;
                break;
            }
        }

        return $validName;

    }
public static function isUnderscoreName ( $ string ) { // If there are space in the name, it can't be valid. if ( strpos ( $ string , ' ' ) !== false ) { return false ; } if ( $ string !== strtolower ( $ string ) ) { return false ; } $ validName = true ; $ nameBits = explode ( '_' , $ string ) ; foreach ( $ nameBits as $ bit ) { if ( $ bit === '' ) { continue ; } if ( $ bit { 0 } !== strtolower ( $ bit { 0 } ) ) { $ validName = false ; break ; } } return $ validName ; }
Returns true if the specified string is in the underscore caps format.

@param string $string The string to verify.

@return boolean
Returns true if the specified string is in the underscore caps format .