I can not figure out where I'm going wrong.
I've done so many string comparisons before and this one just refuses to work, the code is below;
$comparison_string = 'Transfers';
if ($location_name_chk == 0)
$location_name_chk = 'Not_Transfers_Location';
echo $location_name_chk;
if(strcasecmp($location_name_chk, $comparison_string) == 1) {
echo 'Location not Transfers';
die();
Essentially, it's not getting to the part where it's comparing the strings.
I can 100% confirm that $comparison string == Transfers and that $location_name_chk == Not_Transfers_Location as the echo $location_name_chk does show correctly in the Network Display tab.
Any ideas? I have tried a range of different ideas that are in other questions, but to no avail (trim, strcasecmp etc)
strcasecmp()returns0when the strings are equal.else if(strcasecmp($location_name_chk, $comparison_string) == 0) { echo "Location is Transfers"; }== 0instead of== 1. When the strings are the same you'll get0returned.