php - IF with string read by FGETCSV -


i have problemi in using if statement string read file through fgetcsv command. file start country (without quotes) in first position put if statement @ beginning of code in order verify file correct. if statement is:

if ($data[0]=="country") { … } else {  print $data[0]  } 

the if statement fails but... on screen see word country. means fgetcsv works well, there problems on string comparison. can tell me why if statement fails?

thanks in advance help

giorgio

try comparing this:

if (strtolower(trim($data[0])) == 'country') {   echo 'found'; } else {    print $data[0]  } 

Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Copy range with conditional formatting -

Ansible - ERROR! the field 'hosts' is required but was not set -