how to give a php variable a value of html element code example Example: use php variable in html attributes <span title="<?php echo htmlspecialchars($variable); ?>">