将所有JS和CSS内联到内联?

Assume a website that collects all required css and js file links into an array before including them in a header like so:

<link rel='stylesheet' href='[CSS-FILE-LINK].css' type='text/css' />

<script type='text/javascript' src='[JS-FILE-LINK].js'></script>

Some of those are local files and some are remote.

In general- is there any downside to include the links for the remote ones, but output the local ones inline?

More specifically: My main concern at this moment I guess is with conflicting variable names... CSS I guess just cascades in a way that is meant from the ground up to deal with conflicts/overriding... but JS I'm not sure- does a global variable in one js file conflict with a global variable in another?

Bonus points: Assuming it is a good idea to do this to gain speed due to decreased latency between requests, would it be better to readfile() or file_get_contents() in this case?

The downside is your initial page load will be heavier. If your files are small it's still be a net gain in performance because of the reduced amount of requests.

CSS handles conflicts like you said, JS does not. That is why you should not put things in the global scope.

The JS global variables can make your web works badly, very badly. If you have the change I suggest you to use JS Module pattern so you can have separately namespaces so you don't have the problem with global JS.

If you want to win speed you can use amazon for store static content. You can just cache the request to your css/js files and it will be much faster, is not really hard con set up and is not expensive.

well you could output the CSS from local files (please don't copypaste it, you're definitely in for trouble if you do :D).

What people usually do is that they keep the things linked in development and use concatenation and uglification as soon as it comes to production.

Global JS variables are generally a bad idea and yes, they can conflict (they are attached to the window object, which is globally available).