PHP IF Else Statement Not working -



PHP IF Else Statement Not working -

i'm having problems if statement. why code a not greater b have done wrong? when number greater says it's not?

<?php //vars $a = '454'; $b = '1001'; ?> <?php function difference($val3, $val4) { $subtract = ($val3 - $val4); homecoming $subtract; } // random number generator function function random($min, $max) { homecoming rand($min,$max); } $anum = random(1,$a); $bnum = random(1,$b); $difference = "-170"; //difference($teamanum, $teambnum); function result() { if ($anum > $bnum) { echo "a greater b"; } else { echo "a not greater b"; } } ?> <?php echo "a: ".$teamanum."\n"; echo "b: ".$teambnum."\n"; echo "difference: ".$difference."\n"; echo result()."\n"; ?>

thanks

you out of scope.

function result($anum, $bnum) { if ($anum > $bnum) { echo "a greater b"; } else { echo "a not greater b"; } }

pass variables parameters function.

php

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -