40esp Posted June 10, 2008 Share Posted June 10, 2008 im basically trying to achieve this: $how_many = count($_POST["select"]); $post = $_POST['select']; ?> $values = for ($i=0; $i<$how_many; $i++) {echo $post[$i]." ";} But its not possible, im trying to push array values into one string, and store it in a variable for later use in my script. How would I fix it up to work like this? Link to comment https://forums.phpfreaks.com/topic/109506-getting-an-array-into-a-variable/ Share on other sites More sharing options...
kenrbnsn Posted June 10, 2008 Share Posted June 10, 2008 Just use the implode() function: <?php $values = implode(' ',$_POST); ?> Ken Link to comment https://forums.phpfreaks.com/topic/109506-getting-an-array-into-a-variable/#findComment-561734 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.