note 86301 rejected from control-structures.foreach by danbrown

From: Date: Sat, 11 Oct 2008 20:45:53 +0000
Subject: note 86301 rejected from control-structures.foreach by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-145281@lists.php.net to get a copy of this message
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"

« previous php.notes (#145281) next »