1

I'm going crazy with this BS^^ I have 2 simple JSONs that I convert to an array. I compare these with each other. There are no special characters or "non UTF-8" characters. However, PHPUnit notes a difference.

   ┐
   ├ Failed asserting that two arrays are identical.
   ┊ ---·Expected
   ┊ +++·Actual
   ┊ @@ @@
   ┊      'gender' => 'm'
   ┊ -····'street'·=>·'Windows·Ave.'
   ┊ +····'street'·=>·'Windows·Ave.'
   ┊      'houseNumber' => '3422'
   ┊      'postcode' => '12F000'
   ┊ -····'city'·=>·'Los·Angeles'
   ┊ +····'city'·=>·'Los·Angeles'
   ┊      'country' => 'USA'
   ┊  )

I've already tried this but nothing ... How to replace decoded Non-breakable space (nbsp)

Help... Thanks

Alex
  • 11
  • 1
  • 1
    For debugging purposes, instead of comparing the arrays, try comparing the specific keys in question, and possibly run `bin2hex` and compare those contents. – Chris Haas Oct 25 '21 at 14:45
  • are the whitespaces the same character? Tab or space ? – matiaslauriti Oct 25 '21 at 15:46
  • @ChrisHaas thanks, in the end my code have compared whole arrays instead of single keys. thanks for the idea – Alex Oct 26 '21 at 08:04

0 Answers0