Hướng dẫn dùng ia js trong PHP

I have the following code in PHP:

$v = mb_strlen($linebuffer, 'HTML-ENTITIES');

which works for strings like "X "FUEL"" and returns 8 (X "FUEL").

I need this exact same code in javascript and/or jquery. Does this exist or will I have to write an entire parser in javascript?

asked Apr 12, 2021 at 11:29

4

  • Is this of any help?

    Apr 12, 2021 at 11:32

  • The example in the "duplicate" questions do not apply to HTML. I tried: var x = unescape(encodeURIComponent(linebuffer)).length;

    Apr 12, 2021 at 11:44