forked from jquery-archive/jquery-mobile
-
Notifications
You must be signed in to change notification settings - Fork 2
/
combine.php
26 lines (21 loc) · 584 Bytes
/
combine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
// Get the filetype and array of files
if ( ! isset($type) || ! isset($files) )
{
echo '$type and $files must be specified!';
exit;
}
$contents = '';
if ( isset( $comment ) ) {
$contents .= $comment;
}
// Loop through the files adding them to a string
foreach ( $files as $file ) {
$contents .= file_get_contents($file). "\n\n";
}
// Set the content type, filesize and an expiration so its not cached
header('Content-Type: ' . $type);
header('Content-Length: ' . strlen($contents));
header('Expires: Fri, 01 Jan 2010 05:00:00 GMT');
// Deliver the file
echo $contents;