brown2005 Posted November 27, 2012 Share Posted November 27, 2012 I would like to implode print implode("<br />\n",array_keys($comments)); into <a href="">implode here</a> Quote Link to comment Share on other sites More sharing options...
MDCode Posted November 27, 2012 Share Posted November 27, 2012 Do you have a question? Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 27, 2012 Share Posted November 27, 2012 (edited) Huh? Is this what you mean? echo "<a href=\"\">" . implode("<br />\n",array_keys($comments)) . "</a>" Edited November 27, 2012 by Psycho Quote Link to comment Share on other sites More sharing options...
brown2005 Posted November 28, 2012 Author Share Posted November 28, 2012 Huh? Is this what you mean? echo "<a href=\"\">" . implode("<br />\n",array_keys($comments)) . "</a>" that is the idea, so each keyword that comes from the implode is wrapped in the <a></a> tags tried your code above but that does not work causes a server error Quote Link to comment Share on other sites More sharing options...
brown2005 Posted November 28, 2012 Author Share Posted November 28, 2012 echo'<a href="'.$keywords_id.'">'. implode("<br />\n",array_keys($keywords)) .'</a>.'; right i have this which works apart from it does not have the appropiate id for each keyword? Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 28, 2012 Share Posted November 28, 2012 (edited) If you were to take the time to properly explain your request you would have already had a solution by now. Based upon mine and the other responder's first posts you obviously did a poor job of it. I don't mean to berate you, just point out that it is beneficial to you (and considerate of those providing help) to take the time to effectively write a query. Your last response is much different than your original question and contains a significant change - there are two variables in the strings. You also haven't stated where $keywords_id is coming from. Is it a static variable that will be the same for each $keywords value? What you want to achieve can't be achieved through implode(), but based upon your last response and some of my assumptions for what you have NOT provided, you can try this foreach(array_keys($keywords) as $keyword) { echo "<a href='{$keywords_id}'>{$keyword}</a>."; } Edited November 28, 2012 by Psycho Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.