#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    I start with this:

    $words = "three text things";

    I want $words to equal three+text+things. Can someone give me the syntax for replacing all occurences of spaces with plus signs? It should just be a one liner.

    Thanks! Ryan McKillen




    [This message has been edited by scream (edited July 11, 2000).]
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,648
    Rep Power
    4493
    urlencode($words) will make all spaces a +, it also encodes some other characters. urldecode($words) get's back what you started with.

    ---John Holmes...
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    15
    Thanks a lot! Easier than I thought.

Similar Threads

  1. DBI warnings -- plz help
    By pranesh in forum Perl Programming
    Replies: 4
    Last Post: December 1st, 2003, 07:52 PM
  2. CGI.pm, regular expression proublem
    By xen in forum Perl Programming
    Replies: 6
    Last Post: September 30th, 2003, 09:14 PM
  3. quick regular expression help
    By Jay Edgar in forum PHP Development
    Replies: 2
    Last Post: June 26th, 2003, 02:02 PM
  4. regular expression help --href extraction
    By pchad in forum PHP Development
    Replies: 7
    Last Post: September 1st, 2002, 08:47 PM
  5. $variable = regular expression match..?
    By dave_mwi in forum Perl Programming
    Replies: 2
    Last Post: April 12th, 2002, 05:43 PM

IMN logo majestic logo threadwatch logo seochat tools logo