What is the best way to output html and php variables using php?
Posted on 2008-10-30
My question is based on opinion on what is the best and easiest way to output html that is mixed with php variables within a php script. As a beginning programmer I was always told to use something like this:
<?PHP echo '<p>My name is '.$name.'! And I live in '.$place.'.</p>';?>
This way doesn't seem to be the best or easiest way to get an html output page and this way is also hard to debug. What other ways are available that are easier and considered the more accurate way to output html? I have seen some functions but don't know what ones are right for me. Any guidance would be well appreciated.