Convert a Japanese half-width katakana to a full-width katakana

Source: Internet
Author: User

// Partition text columns including delimiter and array delimiter. Note: The full-angle, full-angle, and half-width slice names are English letters, numbers, and numbers.
Function my_split ($ string ){
$ COUNT = mb_strlen ($ string );
For ($ I = 0; $ I <$ count ;){
$ Ordvalue = ord (substr ($ string, $ I, 1 ));
If ($ ordvalue = 131 | $ ordvalue = 130 | $ ordvalue = 129 ){
$ RET [] = substr ($ string, $ I, 2 );
$ I + = 2;
} Else {
$ RET [] = substr ($ string, $ I, 1 );
$ I + = 1;
}
}
Return $ ret;
}

// The half-width slice is named full-width slice.
Function convkanazenhan ($ Str)
{
$ Kanabefore = "there are too many other large numbers of small numbers of bytes. please refer to the following link for more information: please refer to the following link for more information: j k l m n o p q r s t u v w x y z a B c d e f g h I j k l m n o p q r s t U V W x y z, ";
$ Kanaafter = "too many attempts have been made even though there are too many attempts to handle these issues before they occur. please refer to the following link for more information: ロヮワヲー a B c d e f g h I j k l m n o p q r s t u v w x y z A B C D E F G H I j k l m n o p q r s t u v w x Y Z ,";

$ Array = my_split ($ Str );

$ Backslash = explode ("", $ kanabefore );
$ Chairman = explode ("", $ kanaafter );

$ Restr = "";
Foreach ($ array as $ key => $ value ){
$ Pos = array_search ($ value, $ backslash );
If ($ Pos = array_search ($ value, $ backslash ))! = NULL ){
$ Restr. = $ Chairman [$ POS];
} Else {
$ Restr. = $ value;
}
}
Return $ restr;
}
Echo convkanazenhan please refer to the following link for more information: ロヮワヲー a B c d e f g h I j k l m n o p q r s t u v w x y z A B C D E F G H I j k l m n o p q r s t u v w x Y Z ,");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.