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.
source
share