Quantcast
Channel: PHP - a function to "sanitize" a string - Stack Overflow
Viewing all articles
Browse latest Browse all 7

PHP - a function to "sanitize" a string

$
0
0

is there any PHP function available that replaces spaces and underscores from a string with dashes?

Like:

Some WordSome_WordSome___WordSome     WordSome ) # $ ^ Word

=>some-word

basically, the sanitized string should only contain a-z characters, numbers (0-9), and dashes (-).


Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>