I'm stuck. I just want a simple OR inside an if condition and php always raises an error:
My Code:
if( ($value > 0.01 || $seconds < 100) ):
Error:
Parse error: syntax error, unexpected T_VARIABLE
I'm stuck. I just want a simple OR inside an if condition and php always raises an error:
My Code:
if( ($value > 0.01 || $seconds < 100) ):
Error:
Parse error: syntax error, unexpected T_VARIABLE
You need to provide more code, The following code works at my computer:
<?php
$value = 2;
$seconds = 10;
if( ($value > 0.01 || $seconds < 100) ) {
echo("OK");
} else {
echo("fail");
}
?>
Unexpected parser token errors usually indicate you have a syntax or nesting error somewhere at or before the given line, so make sure you check your previous lines too. You might just be missing a semicolon or closing bracket somewhere.