I am using the htmlspecialchars function in my line. But I don’t want to clean them,
<b>, <br>, <p> <ul>,<li> bla bla...
Example: Mystring = "<script>.....</script><br><b>test</b><p>aaaa</p>";
Mystring = "<script>.....</script><br><b>test</b><p>aaaa</p>";
I want to; =
<script>.....</script>
Check out the HTML cleaner , and especially the whitelist .
This is probably the safest approach if you allow HTML tags. You can see the comparison here .
Do you want to delete all tags? Use strip_tags () .
HTML Sanitizer Class - http://www.phpclasses.org/browse/package/3746.html
PHP: strip_tags($text, '<p><a><li><b>');
strip_tags($text, '<p><a><li><b>');
- , HTML .
In the above example, I clear $ text from all tags except <p><a><li><b>;
<p><a><li><b>
This PHP function will clear user input if you don't submit <script>or </div>to break your page.
<script>
</div>
Source: https://habr.com/ru/post/1736879/More articles:Как загрузить файл app.config в DLL - .netHow to get the size of a file uploaded to SQL-Server? - sqlDiscrepancy between the detected versions of the program and the library - linuxChange the auto-increment field to the previous one - sqlHow to resize JTextField? - javaHow jquery works with files - javascriptLibPNG + Boost :: GIL: png_infopp_NULL not found - libpngПользовательский интерфейс ускорителя в JavaScript - javascriptHow to determine the texture of the image? - algorithmЗащищенное перечисление не возможно в С# - c#All Articles