Assume no byte cache.
Will the my_func be parsed before a & b are included, or after?
$x=my_func();
//a.php and b.php are **very** heavy scripts
include ('a.php');
include ('b.php');
//my_func makes the browser use it's cached version of the page.
function my_func(){
//send caching headers
//header(....);
exit;
}
Yes, my_func will be called before the includes are executed. They're effectively a "run time" mechanism, rather than parse time. You can even include conditionally, by wrapping them in flow control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With