Ninjakreborn Posted November 20, 2006 Share Posted November 20, 2006 [code]<?phpimplode(", ", $_SESSION['temp']['actiontaken'])?>[/code]This will take an array and put it in a comma seperated list for display, but it's taking the key naturally, I need to find an alternative so I can get the "values" themselves in a comma seperated list. Implode is for the key's in an array, what is for the values in an array. Link to comment https://forums.phpfreaks.com/topic/27883-implode-with-values-instead-of-keys/ Share on other sites More sharing options...
trq Posted November 20, 2006 Share Posted November 20, 2006 What are yo talking about? Implode (used as you have will produce a comma seperated string of the arrays values not keys. eg;[code]<?php $a = array("foo" => "bar", "boo" => "betty"); $x = implode(", ",$a); echo $x; // bar, betty?>[/code] Link to comment https://forums.phpfreaks.com/topic/27883-implode-with-values-instead-of-keys/#findComment-127514 Share on other sites More sharing options...
Ninjakreborn Posted November 20, 2006 Author Share Posted November 20, 2006 Ah thanks, I was using it wrong, thanks again. Link to comment https://forums.phpfreaks.com/topic/27883-implode-with-values-instead-of-keys/#findComment-127529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.