[SOLVED] array into one variable output

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
irealms
Forum Contributor
Posts: 215
Joined: Mon Apr 28, 2003 7:10 am
Location: Leeds

[SOLVED] array into one variable output

Post by irealms »

output array contents into variable?

i have this code

Code: Select all

<?php
		while ($orow = mysql_fetch_assoc($oq))
	{
		$afforders[] = $orow['orderno'];
	}
	foreach ($afforders as $afforders) 
		{
	 echo ''.$afforders.',';
	}

?>
and it outputs in a string, but i need to output that string into one variable? can't seem to get it to work atm.
Last edited by irealms on Tue Nov 02, 2004 2:15 am, edited 1 time in total.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

[php_man]implode()[/php_man]

or

Code: Select all

$var .= $next_element;
Post Reply