I have a page.html with just 48 in it. I can’t get this if statement to work.
<?php
$myFile = 'http://site.com/page.html';
$content = file_get_contents($myFile);
?>
<?php $num = "48"; ?>
<?php if ($content == $num): ?>
true
<?php else: ?>
false
<?php endif; ?>
If I do this it works.
<?php if ($content == 48): ?>
true
<?php else: ?>
false
<?php endif; ?>
How can I change this to make it work?
Think this should work:
..by using trim() which removes these characters: