I want to call a function in PHP, that changes existing variables without returning a specific one.
Here an example:
<?php
$number1 = 5;
$number2 = 3;
echo $number1;
echo $number2; //shows the unmodified numbers
modifyNumbers($number1, $number2); // Modifies the Numbers
echo $number1;
echo $number2; //shows the modified numbers
?>
<!-- Stuff -->
<?php
function modifyNumbers($number1, $number2) {
/* Doing math stuff with the numbers */
/* No return because many numbers were changed / overwritten
}
?>
Basically, I want to make a function that is just overwriting variables instead of giving a specific value back to a specific variable where the function is called.
Thanks in advance!