How can I use the htmlentities function to convert special characters to HTML entities in PHP? Example code: - Biz Tech

How can I use the htmlentities function to convert special characters to HTML entities in PHP? Example code:

Listen
$string = "The quick brown fox & jumps over the lazy dog";

$html_string = htmlentities($string);

echo $html_string;