help me! programmers

Discussion in 'Programming' started by Digitalguy, Dec 27, 2008.

  1. #1
    i'm searching for a code or a script to convert a set of keywords with space in to keyword with commas. please help me out programmers.

    eg:- keyword1 keyword2 keyword3 keyword4 keyword -----> keyword1,keyword2,keyword3,keyword5
     
    Digitalguy, Dec 27, 2008 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    $keywords = "keyword1 keyword2 keyword3 keyword4 keyword";
    $keywords = str_replace(" ", "," $keywords);
     
    crivion, Dec 27, 2008 IP
  3. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #3
    i'm getting this error! :(

     
    Digitalguy, Dec 27, 2008 IP
  4. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #4
    $keywords = "keyword1 keyword2 keyword3 keyword4 keyword";
    $keywords = str_replace(" ", ",", $keywords);

    try this

    i think comma is missing from $keywords.
     
    khan11, Dec 27, 2008 IP
  5. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #5
    now i see a blank page! do i have to put any print commands ? if yes... how can i do it ? :)
     
    Digitalguy, Dec 27, 2008 IP
  6. heakset

    heakset Peon

    Messages:
    277
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You could use echo to print it to screen

    echo "$keywords";
     
    heakset, Dec 27, 2008 IP
  7. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #7
    i'm still getting a blank page! what am i missing ? :D
     
    Digitalguy, Dec 28, 2008 IP
  8. hassanahmad1

    hassanahmad1 Active Member

    Messages:
    150
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #8
    brain - i think :)
     
    hassanahmad1, Dec 28, 2008 IP
  9. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #9
    hassanahmad1 i'm still new to php! i suggest you to learn some forum manners before you showup here with your stupid comments. is there anyone else who can help me out ?
     
    Digitalguy, Dec 28, 2008 IP
  10. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #10
    First try this :

    $keywords = "keyword1 keyword2 keyword3 keyword4 keyword";
    print $keywords;

    If you get keyword printed then try this :

    $keywords = str_replace(" ", ",", $keywords);
    print $keywords;

    Then tell us.
     
    harrisunderwork, Dec 28, 2008 IP
    Digitalguy likes this.
  11. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #11
    yes i managed to print the results! thanks a million harrisunderwork!

    harri how can i put an input textbox with a button somewhere in that code? i'm planning to enter the keywords there.

    here is the scenario

    * copy pasting keywords in to the text box!

    * clicking on the button

    * the results get printed on the page

    i dont know whether i have used the correct technical word! please excuse my noobness. :)

    Regards
    Digitalguy
     
    Digitalguy, Dec 28, 2008 IP
  12. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #12
    Well no problem with terms.

    First of all you need an html form with text box and a submit button.

    After entering the keywords and hitting submit button , after some usual coding, my above code will start working.

    As I a busy or else I would have coded for you.

    Check some html tuts for a quicke form tutorial.

    Then go through a tutorial of handling forms with php.

    That's it.

    BTW, a reputation will be very much appreciated :)
     
    harrisunderwork, Dec 28, 2008 IP
  13. Digitalguy

    Digitalguy Active Member

    Messages:
    545
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #13
    sounds like an interesting tip! i never thought we can mixup other coding languages with php. thanks again harrisunderwork .
     
    Digitalguy, Dec 28, 2008 IP