chantown Posted December 25, 2007 Share Posted December 25, 2007 I have this string , called $email. if I do die($email), it outputs [email protected] But when I do: $email = "<$email>"; die($email), it SHOULD output <[email protected]> but instead, it outputs nothing! does anyone know why? I tried doing echo "<".$email.">";, but nothing works Link to comment https://forums.phpfreaks.com/topic/83179-i-have-a-problem-with-a-string/ Share on other sites More sharing options...
revraz Posted December 25, 2007 Share Posted December 25, 2007 < > are HTML tags. Link to comment https://forums.phpfreaks.com/topic/83179-i-have-a-problem-with-a-string/#findComment-423082 Share on other sites More sharing options...
sKunKbad Posted December 25, 2007 Share Posted December 25, 2007 echo "<" . $email . ">"; //why doesn't this work? Link to comment https://forums.phpfreaks.com/topic/83179-i-have-a-problem-with-a-string/#findComment-423086 Share on other sites More sharing options...
kenrbnsn Posted December 25, 2007 Share Posted December 25, 2007 If you want to see the string "<[email protected]>" on your screen, you need to do: <?php echo htmlentities('<[email protected]>'); ?> Ken Link to comment https://forums.phpfreaks.com/topic/83179-i-have-a-problem-with-a-string/#findComment-423088 Share on other sites More sharing options...
sKunKbad Posted December 25, 2007 Share Posted December 25, 2007 or use < and > directly echo "<$email>"; Link to comment https://forums.phpfreaks.com/topic/83179-i-have-a-problem-with-a-string/#findComment-423089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.