将js文件列表显示到php数组列表中

I have this function for show list of .js file in bottom of page.

function load_js($js, $file = '')
{
    global $_admin_js;
    if ($file != '') {
        $file = preg_replace('/\\\/', '/', dirname($file));
    }
    $_admin_js [] = array(
        $js,
        $file
    );
}

add js file(ie page.php):

global $_admin_js;
load_js('admin/templates/js/jquery.icheck.min.js');
load_js('admin/templates/js/select2.js');

for result:

global $_admin_js;
    $value = '';
    foreach ( $_admin_js as $js ) {
        echo $js[0];
    }

and result is: admin/templates/js/jquery.icheck.min.js admin/templates/js/select2.js

this worked but i need to print result in PHP array like this :

$exclude = array( 
    'admin/templates/js/jquery.icheck.min.js',
    'admin/templates/js/select2.js' 
);

How do show result in php array list?!

Almost there, just need to push the values into an array.

$exclude = []; 
foreach ($_admin_js as $js ) {
    $exclude[]= $js[0];
}

This should give you the results you want.