echo "<noreply@mysite.com>";
The result is blank when you view this with a browser. PHP reads < > as html tags. How can I literally echo <>, so they show up in my browser just like <> or so I can set <noreply@mysite.com> to a variable and echo the variable?
How to literally echo the greater than and less than signs?
Moderator: General Moderators
Re: How to literally echo the greater than and less than signs?
No, PHP doesn't, but your browser does (because it expects html, not plain text).daneditty wrote:PHP reads < > as html tags.
Try the htmlspecialchars function:
Code: Select all
$myAddress = "<noreply@yoursite.com>";
echo htmlspecialchars($myAddress);Re: How to literally echo the greater than and less than signs?
Muchas gracias!
You rock!
You rock!