- htmlentities: documentation ( source)
- htmlspecialchars: documentation ( source)
<?php
echo htmlentities('https://exaple.com/path?userInput1=USER_INPUT&userInput2=USER_INPUT') . PHP_EOL;
echo htmlspecialchars('https://exaple.com/path?userInput1=USER_INPUT&userInput2=USER_INPUT');