I've now performed some more tests. I wanted to actually see if there are any other characters being stored in this string, so i split the string into an array and counted the array. The array has 32 elements when it should have 19. This means somehow theres 13 addition characters which i'm unable to see.
all of the additional elements seem to be empty.
Any more ideas? This is proving to be quite difficult.
I finally solved this problem. Turns out somehow some hidden ASCII control characters where getting in there. Thanks to this page here I was able to use the following code to remove these characters then the comparison worked perfectly.
Code to remove hidden ASCII control characters:
preg_replace('/[\x00-\x1F\x7F]/', '', $input);Go to the full post