Loop through an array php

前端 未结 5 883
故里飘歌
故里飘歌 2020-11-22 17:13

I have this array... how do you print each of the filepath and filename? What is the best way to do this?

  Array ( 
    [0] => Array ( 
             [fid         


        
5条回答
  •  情话喂你
    2020-11-22 17:42

    Starting simple, with no HTML:

    foreach($database as $file) {
        echo $file['filename'] . ' at ' . $file['filepath'];
    }
    

    And you can otherwise manipulate the fields in the foreach.

提交回复
热议问题