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
$keywords = "keyword1 keyword2 keyword3 keyword4 keyword"; $keywords = str_replace(" ", "," $keywords);
$keywords = "keyword1 keyword2 keyword3 keyword4 keyword"; $keywords = str_replace(" ", ",", $keywords); try this i think comma is missing from $keywords.
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 ?
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.
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
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
sounds like an interesting tip! i never thought we can mixup other coding languages with php. thanks again harrisunderwork .