elfuser Posted March 9, 2010 Share Posted March 9, 2010 I am trying to use a html tag in an if statement, but for some reason it is not working. can anybody give me some insight into what might be going on. Thanks in advance for any help. <html> <?php $lines = file('http://www.example.com'); $ta = htmlspecialchars('<body>'); foreach ($lines as $line_num => $line) { echo "Is this ".htmlspecialchars($line)." the same as this ".$ta."?<br>"; if(htmlspecialchars($line) === $ta) { echo "YES<br>"; } else { echo "NOT<br>"; } } ?> </html> Link to comment https://forums.phpfreaks.com/topic/194575-html-in-if-statement/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.