Php: echo vs include html file
In a php script: -What is the difference between
echo "<p>info</p>"
and simply writting html content (what include "htmlfile" basically does)?
include "file.html"
Observation: I read that echo sends a command to web server to send http response, while including a html file waits till the processing php code is done.
In the latter case, does the php module "echoes" at the end of the processing all the html that was written in the php file?
Thank you!
Answer
Solution:
Here is what I realised:
-takes the php file
-if it encounters html tags (outside any php tag), it sends to output buffer
-if it encounters php tags, it execute php code inside.
I hope this can be helping for you in case you have wonders like mine.