I have some functions that work together. But I need to print inside my html
some variables used on these functions.
I know I Could:
- Echo the variable from within the function(function needs to echo it);
- echo the variable itself (but it needs to be global);
- Replicate those variables with globals (not a good thing to do);
Is it possible to print a variable that is NOT global, that is inside a function?
File.php
function myFunc()
{
$var1
//code...
}
HTML
<td> <?= echo $var1 ?></td>