I have successfully written a dynamic form with output of the form and data posted to mysql. What I'd like to do now is save the output of my php to a variable which I can then pass to html2pdf for pdf generation. I've tried to outline my current file along with what I'd like below.
What I have:
if submitted do this {
post data stored to variables
dynamic form output including:
field validation
form data displayed in multiple tables
multiple foreach loops of dynamic data with html tables and php variables within table cells.
}
else do this {
display form and collect user input
submit buttons
}
What I'd like
if submitted do this {
post data stored to variables
$var1 = dynamic form output including:
field validation
form data displayed in multiple tables
foreach loop of dynamic data
echo $var1;
}
else do this {
display form and collect user input
submit buttons
}
It doesn't look like ob_start(); and ob_get_clean(); gets me to where I need nor do php's heredoc strings. Any thoughts or examples would be much appreciated.