-1

I have a entity string such as /&#601;d&#618;&#643;<sup>&#601;</sup>n/ in my database.

I want to convert this entity to its vowel word like this '/ədɪʃ<sup>ə</sup>n/'. I want this convert in php for checking.

Can anyone suggest a solution for this ?

I want to convert this entity #601; ipa number to its corresponding vowel letter.

Umar Abdullah
  • 1,282
  • 1
  • 19
  • 37
webdev
  • 41
  • 1
  • 7
  • I see both of your strings are same – Shobi Jan 16 '19 at 07:14
  • & #601; this is the entity – webdev Jan 16 '19 at 07:15
  • 2
    It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. A good way to demonstrate this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check [FAQ](https://stackoverflow.com/tour) and [How to Ask](https://stackoverflow.com/help/how-to-ask) – Angel M. Jan 16 '19 at 07:21
  • 2
    @Umar it looks like you took some liberties while editing. Please leave the task of clarifying to the OP. Dear question upvoter, please do not neutralize downvotes on Unclear questions. – mickmackusa Jan 16 '19 at 07:21
  • @mickmackusa: what do you mean by OP? – Umar Abdullah Jan 16 '19 at 07:22
  • Original Poster. "The question asker" – mickmackusa Jan 16 '19 at 07:23
  • @mickmackusa It seems webdev approved the edit, so I'd say there's no problem here. – Yoshi Jan 16 '19 at 07:28

2 Answers2

3

you mean html_entity_decode();

you can use html_entity_decode() to decode an html entity to its character version

eg: echo html_entity_decode('&#601'); // outputs ə

Shobi
  • 10,374
  • 6
  • 46
  • 82
  • When I am using this function its showing like this /É‘ËftÉ™nuËn/ – webdev Jan 16 '19 at 07:23
  • 3
    Sounds like a job for "**UTF-8 All The Way Through**" https://stackoverflow.com/q/279170/2943403 – mickmackusa Jan 16 '19 at 07:24
  • For example `/merɪt/` this should be converted to its corresponding form... – webdev Jan 16 '19 at 07:24
  • probably you need some regular expressions to find them and replace if you are going to do it entirely manual. as @mickmackusa suggested, You might want to dig into some UTF8 resources – Shobi Jan 16 '19 at 07:27
0

Try this code you need to decode and encode the code

$myCaption = html_entity_decode('/&#601;d&#618;&#643;<sup>&#601;</sup>n/');

//encode
$myCaptionEncoded = htmlentities($myCaption, ENT_QUOTES);

echo $myCaptionEncoded;
Shibon
  • 1,552
  • 2
  • 9
  • 20