chantown Posted December 25, 2007 Share Posted December 25, 2007 I have this string , called $email. if I do die($email), it outputs email@msn.com But when I do: $email = "<$email>"; die($email), it SHOULD output <email@msn.com> but instead, it outputs nothing! does anyone know why? I tried doing echo "<".$email.">";, but nothing works Quote 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. Quote 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? Quote 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 "<xyz@example.com>" on your screen, you need to do: <?php echo htmlentities('<xyz@example.com>'); ?> Ken Quote 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>"; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.