Re: Function calls 101
| From: | David Newcomb | Date: | Thu, 06 Jul 2000 17:40:07 +0000 |
| Subject: | Re: Function calls 101 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5249@lists.php.net to get a copy of this message | ||
Nashirak,
Just as aside you may want to look at assocated arrays to make your
function calls more managible. For example:
<?php
$a = array();
$a[item] = "Sandwitch";
$a[servoz] = "5.9";
$a[serveg] = "167";
: etc
: etc
DisplayTable($a);
function DisplayTable($locala)
{
reset($locala);
echo "$locala[item]<br>\n";
while (list($k,$v) = each($locala))
{
echo "$k = $v<br>\n";
}
}
?>
Just a thought!
----- Original Message -----
From: Nashirak Bosk <nashirak@mindspring.com>
To: <php-general@lists.php.net>
Sent: Thursday, July 06, 2000 4:01 PM
Subject: [PHP] Function calls 101
> [snip]
> <?php
> DisplayTable
>
("Sandwich","5.9","167","290","24","48","9","14","80","27","2","10","50","17
","29","10","0","8","0","0","10","870","36","1","4");
> function DisplayTable ($Item, $Servoz, $Serveg, $Cal, $Prog, $Prodv,
> Fatg, $fatdv, $CFatc, $CFatp, $SFatg, $SFatdv, $Cholmg, $Choldv, $Carbg,
> $Carbdv, $Sugg, $VA, $VC, $Ca, $Ir, $Sodmg, $Soddv, $Fbg, $Fbdv) {
>
> ... This is where the function stuff is ......
>
> }
> ?>
> [snip]