Re: Converting a Unicode code to related charachter
| From: | Fatih P. | Date: | Sun, 18 Dec 2011 10:41:09 +0000 |
| Subject: | Re: Converting a Unicode code to related charachter | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316059@lists.php.net to get a copy of this message | ||
there is iconv to do this. you should better check that.
On Sun, Dec 18, 2011 at 11:33 AM, Ali Asghar Toraby Parizy <
aliasghar.toraby@gmail.com> wrote:
> Hi.
> As I was writing a php code last week, I struggled with a function that was
> supposed to convert Unicode code to a character. At last I wrote this
> function:
>
> function unicodeToChr($param) {
>
> $a =json_decode('{"t":"'.$param.'"}');
>
> return $a->t;
> }
>
>
> In this function the $param should be something like '\u0627'. I want to
> know if it's acceptable to use this function? Does exist any better
> solution to do that?
> Thanks.
>