I seem to be stuck on comparing two variables. Everything I have tried appears to say they are equal, but the If condition returns false every time.
Here is the problematic code
here is the sample input data:
reckey = '83217 1680'
jobid = '83217'
boring = '1 '
CONTNUMB = '680'
The result of both $cKey and $rKey are as follows:
Type = string
Value = (Actual output) r and c not the same=`83217 1680`-`83217 1680` - this is the actual output delimited with the ` to show there are no leading or trailing spaces.
Here is the problematic code
Code:
$cBoring = str_pad(trim($this->r[$key]["BORING"]),5,' ',STR_PAD_LEFT); $cContainer = str_pad(trim($this->r[$key]["CONTNUMB"]),3,' ',STR_PAD_LEFT); $cKey = $this->r[$key]["JOBID"] . $cBoring . $cContainer; $rKey = trim($this->r[$key]["reckey"]); /* I then use this simple test to check the values of each variable */ if (($rKey != $cKey) ){ /* here I'm just checking to make sure they are the */same type $rtype = gettype ( $rKey ); $ctype = gettype ( $cKey ); /*here I'm just capturing the results for my ajax reponse*/ $fErr = $fErr .' r and c not the same=`'.$rKey.'`-`'.$cKey.'` rType='.$rtype.' cType='.$ctype; }
here is the sample input data:
reckey = '83217 1680'
jobid = '83217'
boring = '1 '
CONTNUMB = '680'
The result of both $cKey and $rKey are as follows:
Type = string
Value = (Actual output) r and c not the same=`83217 1680`-`83217 1680` - this is the actual output delimited with the ` to show there are no leading or trailing spaces.
Comment