0

I want to convert my string to Unicode like if "ग" than give output like "0917" or "917" any one of them.

Link for Unicode of string i want

Please give me a Hint i used ord() but it's not work proper.

$ord = mb_convert_encoding("ग", 'HTML-ENTITIES', 'UTF-8');
echo $ord;

$ord = ord("ग");
echo $ord;    // 224 output

Both try but not working.

Gunjan Patel
  • 2,342
  • 4
  • 24
  • 45
  • Instead of the link (that could break), please include any relevant code and data in your question please. – rfornal Dec 12 '14 at 11:56
  • 1
    ‘Not working’ is a *really* poor description of a problem. What happened? Did it print the wrong value? Did it not print anything? Did something catch fire? (Note that those values are in hexadecimal, so if you got 2327 instead of 917 you're seeing the decimal value.) – Biffen Dec 12 '14 at 11:58
  • [Here][1] you can find a working answer: [1]: http://stackoverflow.com/questions/9361303/can-i-get-the-unicode-value-of-a-character-or-vise-versa-with-php – LWjuniOr Dec 12 '14 at 12:04
  • @LWjuniOr Thanks for help it's useful for me can you please comment it i can accept that. – Gunjan Patel Dec 12 '14 at 12:11

1 Answers1

1

iconv — Convert string to requested character encoding

http://php.net/manual/en/function.iconv.php