I had it in an array and it worked fine now I want to insert it in a Multidimensional Array.
This is my code, not sure what I am doing or if even its poasable,
I want that the getFilename() should be assigned to a key,
Thanks for any help!
$array_name = 1;
$fileSystemIterator = new FilesystemIterator('work/');
$someArray = array();
foreach ($fileSystemIterator as $fileInfo){
$array_name = array(
'alt' => "some text",
'link_to' => "some text",
'img_url' => "$fileInfo->getFilename()"
),
$array_name++
}
)
Check your double quotes in your array value for img_url.
PS: Notice I also changed the comma to a semicolon after your array.
(and... ident your code!)