video #23 - Advance PHP - Include / Require
0 بار بازدید -
2 ماه پیش
-
The ‘include’ and ‘require’ statements.
The ‘include’ and ‘require’ statements. The ‘include’ and ‘require’ statements is use to include within itself another file’s content. It just includes all text including “html & PHP” scripts.
You can use the ‘include’ statement to break an html file into several sections which I do most of the time. It is a great techniques for “headers/footers”.
This saves you a lot of time and keeps your project organized. You can create a standard header, footer, or menus file for all of your web pages.
All you have to do is use the ‘include’ or ‘require’ statement.
Again, this is a great way to organize your scripts. Both of these statements are identical, except when you get a failure.
The ‘require’ statement will produce a fatal error (E_COMPILE_ERROR) and stop the script. The ‘include’ will only produce a warning (E_WARNING) and the script continues.
So, if you want the execution to go on and show users the output of your failure then use the ‘include’ statement.
You can use the ‘include’ statement to break an html file into several sections which I do most of the time. It is a great techniques for “headers/footers”.
This saves you a lot of time and keeps your project organized. You can create a standard header, footer, or menus file for all of your web pages.
All you have to do is use the ‘include’ or ‘require’ statement.
Again, this is a great way to organize your scripts. Both of these statements are identical, except when you get a failure.
The ‘require’ statement will produce a fatal error (E_COMPILE_ERROR) and stop the script. The ‘include’ will only produce a warning (E_WARNING) and the script continues.
So, if you want the execution to go on and show users the output of your failure then use the ‘include’ statement.
2 ماه پیش
در تاریخ 1403/04/10 منتشر شده
است.
0
بـار بازدید شده