Jump to content

PHP Newbie needs HELP


rishum

Recommended Posts

Hello everyone,

I have only recently started dabbling with PHP.
I don't have a strong programming background but am determined to learn PHP to enhance my professional profile. I have joined this forum to seek help from people who are much more adept at all things PHP!  :)

What I am currently trying to do is to catch a string, remove the white spaces preceeding and trailing the string, and then replacing the spaces between the words that might be in a string with the # symbol.

My problem is that using the trim() function, all the white spaces may be removed but I will not be able to replace the spaces between the words with a #. I am not able to understand how to go about this. Should I be using a loop to check all characters one-by-one and wherever a space is encountered amongst the characters, it be replaced by a #? Or is there any other simpler way to do it?

Also, can anyone kindly direct me to any code example to achieve what I want to?

I eagerly look forward to hearing form you guys.

Thanks and regards,

Rishum


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.