PKPString::strtoupper PHP Method

strtoupper() static public method

See also: http://ca.php.net/manual/en/function.strtoupper.php
static public strtoupper ( $string ) : string
$string string Input string
return string Upper case version of input string
    static function strtoupper($string)
    {
        if (defined('ENABLE_MBSTRING')) {
            require_once './lib/pkp/lib/phputf8/mbstring/core.php';
        } else {
            require_once './lib/pkp/lib/phputf8/utils/unicode.php';
            require_once './lib/pkp/lib/phputf8/native/core.php';
        }
        return utf8_strtoupper($string);
    }

Usage Example

Esempio n. 1
0
 /**
  * Translate query keywords.
  * @param $searchPhrase string
  * @return The translated search phrase.
  */
 function _translateSearchPhrase($searchPhrase, $backwards = false)
 {
     static $queryKeywords;
     if (is_null($queryKeywords)) {
         // Query keywords.
         $queryKeywords = array(PKPString::strtoupper(__('search.operator.not')) => 'NOT', PKPString::strtoupper(__('search.operator.and')) => 'AND', PKPString::strtoupper(__('search.operator.or')) => 'OR');
     }
     if ($backwards) {
         $translationTable = array_flip($queryKeywords);
     } else {
         $translationTable = $queryKeywords;
     }
     // Translate the search phrase.
     foreach ($translationTable as $translateFrom => $translateTo) {
         $searchPhrase = PKPString::regexp_replace("/(^|\\s){$translateFrom}(\\s|\$)/i", "\\1{$translateTo}\\2", $searchPhrase);
     }
     return $searchPhrase;
 }
All Usage Examples Of PKPString::strtoupper