Jump to content


Photo

simple question


  • Please log in to reply
3 replies to this topic

#1 Relaxer

Relaxer
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationPhilippines

Posted 01 May 2003 - 05:11 PM

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?
\"Work like you don\'t need money. [br] Love like you\'ve never been hurt. [br] Dance like nobody\'s watching.\" [br] - Jessica

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 01 May 2003 - 05:51 PM

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 \"_\".
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 metalblend

metalblend
  • Members
  • PipPipPip
  • Advanced Member
  • 89 posts
  • LocationCalifornia, USA

Posted 01 May 2003 - 10:39 PM

You would not need to use strpos().. like shiva said, use str_replace()

#4 Relaxer

Relaxer
  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationPhilippines

Posted 02 May 2003 - 04:24 AM

Thanks to you guys, the script is now runnin smooth.
\"Work like you don\'t need money. [br] Love like you\'ve never been hurt. [br] Dance like nobody\'s watching.\" [br] - Jessica




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users