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 ...
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?
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:
or
$numbers = countNumbers();
echo Numbers;