PHP 8.4.24 Released!

Voting

: six plus zero?
(Example: nine)

The Note You're Voting On

Anonymous
21 years ago
// 2005/5/30 Justin
    // Chinese_Traditional toupper
    function CT_to_upper($string)
    {        
        $isChineseStart = false;
        
          $new_string = "";
         $i = 0;
          while($i < strlen($string))
          {                   
               if (ord(substr($string,$i,1)) <128)
               {
                   if( $isChineseStart == false )
                       $new_string .= strtoupper(mb_substr($string,$i,1));
                   else       
                       $new_string .= substr($string,$i,1);
               }
               else
               {
                   if( $isChineseStart == false )
                       $isChineseStart = true;
                   else
                       $isChineseStart = false;                       
                     
                     $new_string .= substr($string,$i,1);
               }
               $i++;
          }
          return $new_string;          
    } 
    //

<< Back to user notes page

To Top