Variable > or < 0
-
Hello,
I want to print ‘positive’ or ‘negative’ if {variation} placeholder is > or <0.In a WordPress post with PHP Exec enabled, I tried the following code:
`[jsoncontentimporter url=”https://www……” numberofdisplayeditems=”300″ ]
<?php
$var='{variation}’;
echo $var; // OK – it gets correctly printed.if ($var<0) {
echo ‘negative’;
}
else {
echo ‘positive’; // BAD – It always prints ‘positive’ even if variation equals -35.
}[/jsoncontentimporter]’
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Variable > or < 0’ is closed to new replies.