Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
<body>
<?php
function myTest1($rep_string) {
$rep_string = str_replace("&", "& amp;", $rep_string);
$rep_string = str_replace(">", "& gt;", $rep_string);
$rep_string = str_replace("<", "& lt;", $rep_string);
$rep_string = str_replace("\"", "& quot;", $rep_string);
$rep_string = str_replace("'", "& #039;", $rep_string);
return $rep_string;
}
?>
<?php
echo'<script type="text/javascript">$(document).ready(function(){$("p").text("' . myTest1('& > < " \'') . '");});</script>';
?>
<p></p>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP Click to see more ... 4.6K 408