Relaxer Posted May 1, 2003 Share Posted May 1, 2003 hi, im making a simple form. the data is inputed to the database using mysql. My problem here when i inputted two words. the data in the db has space between words. is there a script or code that will automatically input underscore on this two words? is there a possiblity? Quote Link to comment https://forums.phpfreaks.com/topic/421-simple-question/ Share on other sites More sharing options...
shivabharat Posted May 1, 2003 Share Posted May 1, 2003 so u are trying to replace the blank space with \"_\" is that so? now u can use str_pos and find out the position of the blank space occurance and use str_replace to replace the blank pace with \"_\". Quote Link to comment https://forums.phpfreaks.com/topic/421-simple-question/#findComment-1412 Share on other sites More sharing options...
metalblend Posted May 1, 2003 Share Posted May 1, 2003 You would not need to use strpos().. like shiva said, use str_replace() Quote Link to comment https://forums.phpfreaks.com/topic/421-simple-question/#findComment-1420 Share on other sites More sharing options...
Relaxer Posted May 2, 2003 Author Share Posted May 2, 2003 Thanks to you guys, the script is now runnin smooth. Quote Link to comment https://forums.phpfreaks.com/topic/421-simple-question/#findComment-1424 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.