This may be a sketchy solution, and I would appreciate if anyone would indicate if this is a bad idea, as this is not a standard use of functions. I managed to get HTML from a PHP function without creating a return value as a string with the following:
function noStrings() { echo ''?> <div>[Whatever HTML you want]</div> <?php; }
Just a "call" function:
noStrings();
And he will output:
<div>[Whatever HTML you want]</div>
Using this method, you can also define PHP variables inside a function and derive them from HTML.
Lorien Brune Nov 13 2018-11-11T00: 00Z
source share