htmlspecialchars()
functionCertain characters such as (&
, "
, '
, <
, >
) have special significance in HTML, and should be converted to HTML entities. You can use the PHP htmlspecialchars()
function to convert special characters in a string to HTML entities. Let's check out an example:
<?php
$my_str = "String with <b>special</b> characters.";
// Removing HTML special characters
echo htmlspecialchars($my_str);
?>
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to combine two strings in PHP
Use the PHP Concatenation Operator Yo...How to hide dropdown menu on click outside of the element in jQuery
Use the jQuery on() method You can us...How to Add Remove Items from Javascript Array
There are four basic methods t...Wifi Networks "Device not ready" error solve in Linux
While working on my Ubuntu system,...How to Scroll to the Top of the Page Using jQuery/JavaScript
Use the scrollTop Property You can us...