note 86301 rejected from control-structures.foreach by danbrown

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: Guille 

----

I need help with my foreach loop

How do I return the value of the entire array? I used a foreach loop like this one:

<?php function Helpme()
	{
		global $hola;
		$invoice = $_SESSION['invoice'];
		$cart = $_SESSION['carrito'];	 
		$invoice->cart = $cart;
		$_SESSION['invoice'] = $invoice;
		
		foreach ($invoice->cart->items as $id=>$item ) 
		{
			$target = array($id," ");
			//print $target[0];
			$hola = implode("",$target);
			
			echo gettype($hola);
			//return $hola;
		} 
		
	}
	Helpme();
?>
I don't get the values of the array "$id"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.