lundi 10 février 2020

Short question, function will run if i put it in if(function())?

Example:

function:

$testvar = 1;
function test() {
  $testvar += 1;
  return "CORRECT";
}

statement:

if(test() == "CORRECT")
{
 // DO SOMETHING
}

(i don't use true in my API and i want to know if i put a function in an 'if statement', the function will run and return what is inside of quotes)

Aucun commentaire:

Enregistrer un commentaire