Maybe I missed something, but really, I can't find a solution for this.
I want to change the format of the array I get from a glob
function.
This is how my code looks now.
$my_files = glob('*.php');
and the result is an array:
array(
'0' => 'about.php',
'1' => 'admin-ajax.php',
'2' => 'admin-footer.php',
'3' => 'admin-functions.php',
'4' => 'admin-header.php',
'5' => 'admin-post.php',
'6' => 'admin.php',
)
Now this is what exactly I want to have(to change the numbers with the text for each array, respectively):
array(
'about.php' => 'about.php',
'admin-ajax.php' => 'admin-ajax.php',
'admin-footer.php' => 'admin-footer.php',
'admin-functions.php' => 'admin-functions.php',
'admin-header.php' => 'admin-header.php',
'admin-post.php' => 'admin-post.php',
'admin.php' => 'admin.php',
)
I need this as an array to include it using a variable in this way:
array(
'name' => 'Intern download file name',
'id' => $prefix .'blog_post_intern_url',
'type' => 'select',
'options' => $my_files,
),