What is the difference between space and whitespace in PHP?
I saw on different places that to strip out all the spaces use str_replace()
and use preg_replace()
for whitespace.
Here is a reference: https://stackoverflow.com/a/2109339/4003463
In the added context to your question, a space is ascii 32 (that is, what you get when you press the spacebar).
A whitespace is any character that renders as a space, that is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With