PHP to replace a blank character with underscore?

JeryJ55

New member
I have a PHP script and all I need for my one script is to properly change a blank "" ...Yeah nothing, not a space - just blank, with an underscore. I have made my own preg_replace() functions and none work and it is to bad I could not use str_replace("", "_", $x). I am advanced with PHP programming, but just can't figure this one out for myself. I have searched so long with tons and tons of search words in Google and Yahoo. I am tired of hitting "Search". Any quick code for it?

For example:
"abcABC" > "_a_b_c_A_B_C_"

One more thing, don't bother if my example was "a" or "_a" or "a_" I could fix it for myself with a new line in a separate code or edit code given. Numbers and anything else does not have to be included, I only allow alphanumeric characters that is capitalized or not.
 
Back
Top