use php variable in html attributes code example Example: use php variable in html attributes <span title="<?php echo htmlspecialchars($variable); ?>">