Search code examples
phpvar-dump

PHP var_dump counts excessive characters


I have a string with 12 characters but PHP var_dump function counts 15.

PHP code:

var_dump('355 Rue Joly');

Result:

string(15) "355 Rue Joly"

Any explanation? Thanks.


Solution

  • There is a character before the letter 3 and after the first ' which you can't see. You should remove that.

    When you paste it in another editor (visual studio code for example it should show a "?" meaning it doesn't know what character there actually is.)