Jump to content

if statement not working? QUICK QUESTION


snowman15

Recommended Posts

<?php

$lol=2;

if ($lol="1")

{

echo $hello="hello";

}

?>

U need to compare not to initialize the value to something.Here u were initializing the value not comparing.

So use this or as mentioned above.

<?php

$lol=2;

if ($lol==1)//not "1" bcoz quotations only used for strings here

{

echo $hello="hello";

}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.