Question from the PHP8 test

How to escape HTML entities in PHP

Medium

What will this code display:

<?php

$string = "<a href='r&d'>R &amp; D</a>";
echo htmlspecialchars($string, double_encode: false);
Author: Clément DevosStatus: PublishedQuestion passed 963 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!