0
I need a very simple function, but I couldn’t find anything related in my research.
I need a function where I can insert items, and then print these items on another page.
Ex:
function funcaoExibe() {
$var = 'none1';
$var = 'email2';
$var = 'telefone3';
echo $var;
}
Created the function, I need to display all the values of the variables inserted within the function, something like that:
<?= funcaoExibe(); ?>
No resultado aparece somente:
telefone3
I need the three shown, one on each line.
Any idea how I can do it?
places echo within the function
– adventistaam
It is that the function will stay on one page, and the result on another. It will not all stay in the same PHP file.
– Wendler
As you said above, the processing will stay in one file and the result in another. You can return to the html function and display on the desired page.
– TonCunha
I updated the question, the problem is that I don’t know how to create this function.
– Wendler
you are overwriting the variable
$var
. I could not understand properly what you want. The function should receive 3 arguments and print and not have the values defined within it.– rray
You could work with get and set in this case, set puts the information and get the information
– adventistaam