Jump to content

[SOLVED] Quick question


ngreenwood6

Recommended Posts

if ($variable = "Hello" && strlen($variable) > 1 && $variable != NULL)
{
do this
}

 

bad coding, it needs to be  '=='

 

<?php
$variable = 'Helfwfwqlo';
if ($variable = "Hello")
{
echo 1;
}
?>

 

that would echo 1

Not bad coding, just a mistake.....

Bad coding is your

<?php
if ((!$variable)&&(!$variable)&&($variable > 1))
{
do this
}
?>

As you have two conditions which are exactly the same.

Link to comment
Share on other sites

Please keep personal attacks and any other senseless mud slinging out of the forums. There is no need for a tirade of critiqued code. That is what this forums is intended for. If you feel someone has mistreated you or abused the forums in some way, contact a moderator or administrator.

 

**LOCKED**

 

@ngreenwood6 - I apologize if the comments have forced me to lock this code prematurely. If you have further questions, please feel free to start another topic.

Link to comment
Share on other sites

Guest
This topic is now 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.