Strange space characters - utf8 php

I have weird spaces in the line, white spaces are not white spaces. I have a problem converting them with regex and str_replace ie

echo str_replace(' ','_',$string);

any ideas how to fix this? utf8_encode also does not work, regex \ s either, when you copy this text to Notepad ++, it displays as

Ê    

instead of a space.

I'm trying to execute this regex

preg_replace('/[^a-z0-9 ]/i','',$string) 

but since these “spaces” are not spaces, they are also deleted.

+2
source share
1 answer

I think I got it from a PHP site:

You may wonder why

trim(html_entity_decode(' '));    

, ' ' ASCII 32 ( trim()), ASCII- 160 (0xa0) ISO 8859-1 .

+3

All Articles