FluentUtils::toUpperWords PHP 메소드

toUpperWords() 공개 정적인 메소드

Convert "camelCaseWord" to "CAMEL CASE WORD"
public static toUpperWords ( string $string ) : string
$string string
리턴 string
    public static function toUpperWords($string)
    {
        return trim(strtoupper(preg_replace('/(.)([A-Z]+)/', '$1 $2', $string)));
    }

Usage Example

예제 #1
0
 /**
  * @param $clause
  * @param array $parameters - first is $statement followed by $parameters
  * @return $this|SelectQuery
  */
 public function __call($clause, $parameters = array())
 {
     $clause = FluentUtils::toUpperWords($clause);
     if ($clause == 'GROUP') {
         $clause = 'GROUP BY';
     }
     if ($clause == 'ORDER') {
         $clause = 'ORDER BY';
     }
     if ($clause == 'FOOT NOTE') {
         $clause = "\n--";
     }
     $statement = array_shift($parameters);
     if (strpos($clause, 'JOIN') !== FALSE) {
         return $this->addJoinStatements($clause, $statement, $parameters);
     }
     return $this->addStatement($clause, $statement, $parameters);
 }
All Usage Examples Of FluentUtils::toUpperWords