I have a code to declare a variable and then an IF statement which uses that variable to either display, or not display an image.
This code is before HTML
<?php $contents = file("textdocument.txt") ?>
This code is in the HTML
<?php if ( $contents = 10 ) {
echo '<img src="image.png" name="image" border="0">'; }
else {echo "wrong number"; } ?>
The problem I get is no matter what the number is, the image always displays. Do you guys have any solutions for this?