Vivid Lust Posted February 18, 2009 Share Posted February 18, 2009 Hey all, how could I Insert "_" where there is a gap in a string? Such as: This is a sentence Becomes: This_is_a_sentence Thanks all! Quote Link to comment Share on other sites More sharing options...
Prismatic Posted February 18, 2009 Share Posted February 18, 2009 str_replace(" ", "_", $string); Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted February 18, 2009 Author Share Posted February 18, 2009 Oh, and then how could I do the reverse? Thanks Quote Link to comment Share on other sites More sharing options...
Prismatic Posted February 18, 2009 Share Posted February 18, 2009 str_replace("_", " ", $string); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.