This has nothing to do with the thread I made few minutes ago.
Anyways ... I need help with these thing related to PHP-functions:
- How do I set what the function needs to work?
Like ...
Now, how do I declare, that the function I made needs parameters $x and $y to count like so:
countNumber(1, 2);
Second question is, can function return multiple values, like with a loop?
Third is, can I use function directly to output something like so:
or
Anyways ... I need help with these thing related to PHP-functions:
- How do I set what the function needs to work?
Like ...
Code: (php)
function countNumbers() {
echo ($x + $y);
}Now, how do I declare, that the function I made needs parameters $x and $y to count like so:
countNumber(1, 2);
Second question is, can function return multiple values, like with a loop?
Code: (php)
function countNumbers() {
$rtnval = $x + $y;
for ($i = 0; $i <= 5; $i++) {
return $rtnval;
}
}Third is, can I use function directly to output something like so:
Code: (php)
echo countNumbers();or
Code: (php)
$numbers = countNumbers();
echo Numbers;











