How to convert some multibyte characters into its numeric html entity using PHP?

前端 未结 3 1231
挽巷
挽巷 2021-01-03 12:20

Test string:

$s = \"convert this: \";
$s .= \"–, —, †, ‡, •, ≤, ≥, μ, ₪, ©, ® y ™, ⅓, ⅔, ⅛, ⅜, ⅝, ⅞, ™, Ω, ℮, ∑, ⌂, ♀, ♂ \";
$s .= \"but, not convert ordinar         


        
3条回答
  •  遥遥无期
    2021-01-03 13:01

    Well htmlentities doesn't work correctly. Fortunately someone has posted code on the php website that seems to do the translation of multibyte characters properly

提交回复
热议问题