I watch the manual, I see these flags
ENT_SUBSTITUTE ENT_DISALLOWED Explain the difference in principle, from the mana, I really did not understand
I watch the manual, I see these flags
ENT_SUBSTITUTE ENT_DISALLOWED Explain the difference in principle, from the mana, I really did not understand
When using the ENT_SUBSTITUTE flag, ENT_SUBSTITUTE sequences that cannot be treated as UTF-8 characters will be replaced with FFFD, while using ENT_DISALLOWED , an empty string will be returned:
<?php echo '<pre>'; var_dump(htmlspecialchars("a\x80b", ENT_SUBSTITUTE)); // string(5) "a b" var_dump(htmlspecialchars("a\x80b", ENT_DISALLOWED)); // string(0) "" ENT_DISALLOWED flag, but in your example this does not happen ... something is wrong here - MaximProJust an example, for clarity:
echo htmlspecialchars("<\x80The End\xef\xbf\xbf>", ENT_HTML5 | ENT_DISALLOWED | ENT_SUBSTITUTE, 'UTF-8'); \\ < The End > echo htmlspecialchars("<\x80The End\xef\xbf\xbf>", ENT_HTML5 | ENT_SUBSTITUTE, 'UTF-8'); \\ < The End > echo htmlspecialchars("<\x80The End\xef\xbf\xbf>", ENT_HTML5 | ENT_DISALLOWED, 'UTF-8'); \\ ΠΏΡΡΡΠ°Ρ ΡΡΡΠΎΠΊΠ° Π²ΡΠ±ΡΠ°Π½ ΡΠΎΡ ΠΈΠ»ΠΈ ΠΈΠ½ΠΎΠΉ ΡΠ»Π°Π³ not Π²ΡΠ±ΡΠ°Π½ ΡΠΎΡ ΠΈΠ»ΠΈ ΠΈΠ½ΠΎΠΉ ΡΠ»Π°Π³ here ΠΈΠ»ΠΈ , here the ΡΡΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ all the flags specified in the function. - VismanΠΈΠ»ΠΈ ... well, let's take your first example, will it mean that 3 flags will be simultaneously executed as the 2nd argument? ENT_HTML5, ENT_DISALLOWED, ENT_SUBSTITUTE - MaximProSource: https://ru.stackoverflow.com/questions/562469/
All Articles
ΠΡΠΈ Π½Π°Π»ΠΈΡΠΈΠΈ Π²ΠΎ Π²Ρ ΠΎΠ΄Π½ΠΎΠΌ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ΅ string Π½Π΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΠΎΠΉ ΠΏΠΎΡΠ»Π΅Π΄ΠΎΠ²Π°ΡΠ΅Π»ΡΠ½ΠΎΡΡΠΈ ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ² Π² Π·Π°Π΄Π°Π½Π½ΠΎΠΉ ΠΊΠΎΠ΄ΠΈΡΠΎΠ²ΠΊΠ΅ encoding Π±ΡΠ΄Π΅Ρ Π²ΠΎΠ·Π²ΡΠ°ΡΠ΅Π½Π° ΠΏΡΡΡΠ°Ρ ΡΡΡΠΎΠΊΠ°, Π΅ΡΠ»ΠΈ Π½Π΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Ρ ΡΠ»Π°Π³ΠΈ ENT_IGNORE ΠΈΠ»ΠΈ ENT_SUBSTITUTE.There is no talk aboutENT_DISALLOWED. - Visman