Home > Software engineering >  Selector array php to sting
Selector array php to sting

Time:06-28

This is output from print_r ($filename);

How can i select the [filename] so i can out put the two [filename] variables as one string?

Array
(
    [0] => Array
        (
            [filename] => 001-68316-000-9000-000.jpg
        )

    [1] => Array
        (
            [filename] => 001-68316-002-9000-001.jpg
        )

)

CodePudding user response:

foreach ($filename as $item) {
 $file_name .= $item['filename']." ";
}

echo $file_name;

CodePudding user response:

foreach ($filename as $item) {
   echo $item['filename'] . " ";
}

001-68316-000-9000-000.jpg 001-68316-002-9000-001.jpg

  • Related