1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Replacing " " with "-"

Discussion in 'PHP' started by Al Capone, Aug 19, 2005.

  1. #1
    I want to replace " " (spaces) with "-" for this script that I have so the url is more "Search Engine Friendly", the thing in red I want the term to use "-" instead of " " I hope what I am saying makes sense:
    SEMrush
    is this possible and if so how, thanks very much in advance for your help.
     
    Al Capone, Aug 19, 2005 IP
    SEMrush
  2. johnt

    johnt Peon

    Messages:
    178
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use str_replace(" ", "-", $query)
     
    johnt, Aug 19, 2005 IP
  3. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Thanks so much :)
     
    Al Capone, Aug 19, 2005 IP