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"
----
Server IP: 200.6.154.201
Probable Submitter: 200.84.91.207
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/86301
Del: integrated -- https://master.php.net/note/delete/86301/integrated
Del: useless -- https://master.php.net/note/delete/86301/useless
Del: bad code -- https://master.php.net/note/delete/86301/bad+code
Del: spam -- https://master.php.net/note/delete/86301/spam
Del: non-english -- https://master.php.net/note/delete/86301/non-english
Del: in docs -- https://master.php.net/note/delete/86301/in+docs
Del: other reasons-- https://master.php.net/note/delete/86301
Reject -- https://master.php.net/note/reject/86301
Search -- https://master.php.net/manage/user-notes.php
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.