I am getting two different count values for same string
$val1 = $data->sheets[0]['cells'][5][1];//thise value is from excel sheet
$val2 = $obj->number; // this is the value from database
var_dump(trim($val1)) , var_dump(trim($val2))
string(19) "US5922335A" , string(10) "US5922335A"
first values is getting from excel sheet(xls)and The second value is am getting from Mysql table after performing Select query
, i am unable to perform comparision like as both are having different length .
if($val1==$va2)
{
echo "Found it ";
}
How can i make it to have a same length so that i can compare it.
Not a direct answer to your question but let’s first find out what’s really behind that
string(19) "US5922335A". Please tryand add the output which should be something like
to your question.
edit: Your data seems to be little endian UCS-2/UTF-16 encoded.
Since your data source for that string value is an Excel sheet the easiest solution is probably to use mb_convert_encoding() to change the encoding.