Concatenating CSV filenames into a single file
As soon as you find an outdated file,
you can break out from the first loop:

    foreach ($scripts_array as $script) {
            if (filemtime($script) &gt; filemtime($cached_script)) {
                $cache_expired = true;
                break;
            }
    }


And instead of accumulating the script content in a variable,
you can write to a file and echo directly:

if ($cache_expired) {
    unlink($cached_script);
    foreach ($scripts_array as $script) {
        $script = '/public_html/assets/scripts/' . $script;
        if (file_exists($script)) {
            $content = @file_get_contents($script);
            file_put_contents($cached_script, $content, FILE_APPEND);
            echo $content;
        }
    }
} else {
    echo @file_get_contents($cached_script);
}