passing parameters to functions
| From: | T.R. Henigson | Date: | Thu, 20 Jul 2000 17:20:03 +0000 |
| Subject: | passing parameters to functions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7444@lists.php.net to get a copy of this message | ||
I have a function which has four parameters. I can pass variables
to each of the four parameters by calling the function
Example($parameter1=0,$parameter2=0,$parameter3=0,$parameter4=0);
But if I assign the variable $temp, the concatenated string of
the four parameters delimited with commas and then call the function
as follows
$temp=$parameter1.",".$parameter2.",".$parameter3.",".$parameter4;
Example($temp);
It ends up considering $temp as $parameter1 in the function, and then
using default values for the other three parameters. How do I get the
comma-delimited string to map to all four parameters?
Ted Henigson
Bonus question: In quoting strings, if I don't have to do any variable
interpolation, does it matter whether I use single or double quotes?