I'm sure this is a duplicate but I couldn't find the answer through search.

Here's my code

`str_replace([' ',-,\(,\),\*,-,\|,\/], '', $params['telephone']), '0'` 

and that works. What I want it to be is:

`str_replace([' ',-,\(,\),/,|,\*,-,\#,\], '', $params['telephone']), '0'`

As soon as I add in `#` or `\` it fails, and escaping them doesn't seem to work. Is there a different way to escape them?

And although it seemingly works, it does not seem to replace the initial space. Could that be the root of my problem?