Question: I have a PHP page where the header and footer are PHP includes.

I want to know if there is any possibility of the includes loading asynchronously - or does PHP gather all the files required, compile them and send them as one file?

The reason I ask is that I've seen an interesting PHP app that seemed to keep the connection open and do things in sequence before closing the connection - I wondered if that's what happens with includes.

PHP version is 5.3.6

EDIT:
What I actually want is for the page to load all at once, to prevent my layout mashing as each bit loads. Sorry to any who misunderstood this

Answer: 
If your objective is to receive all the page at once you need to use ob\_start() and ob\_end\_flush(). Do something like:

```
ob_start();
...
write all your outputs
...
ob_end_flush();

```

This will force the server to buffer the output until the whole page is prepared.

Good luck!
PHP sends a single document. What you want to do is achieved with something called AJAX (<http://en.wikipedia.org/wiki/Ajax_%28programming%29>)

Basically you write some JavaScript code that uses XMLHTTPRequest object to connect to the server and download some extra info.