Sunday 24 December 2017

php - && Not working in If() statement

For some weird reason this if statement is not finding a
match, when the values are clearly equal to the $change_pct_candle values as shown in
var_dump
below



if($change_pct_candle[1]
>= 0.38022813688214 && $change_pct_candle[2] >= 1.3487475915221) {}




If I
try:



if($change_pct_candle[1]
>= 0.38022813688214) {}



It works. If I
try:



if($change_pct_candle[2]
>= 1.3487475915221)
{}



It
works. When I
try:



if($change_pct_candle[1]
>= 0 && $change_pct_candle[2] >= 1) {}



It works. When I
try:



if($change_pct_candle[1]
>= 0.38022813688214 && $change_pct_candle[2] >= 1.3487475915221) {}




It doesn't
work. Am I doing something wrong here?



The
var_dump of $change_pct_candle
is:



array(7) {

[0]=>
float(-0.10984848484848)
[1]=>

float(0.38022813688214)

[2]=>

float(1.3487475915221)
[3]=>

float(-0.57471264367815)
[4]=>

float(0.19193857965451)
[5]=>

float(0.19230769230769)
[6]=>

float(0.1926782273603)

}

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...