populate a 'select list' from a directory on my server using php and html

前端 未结 2 1256
情歌与酒
情歌与酒 2021-01-24 22:34

Is it possible (I am assuming not) to populate a drop down list from files that are on my website, say in the images folder? in a html form?


                        
    
提交评论

  • 2021-01-24 23:06

    You can use scandir - http://php.net/manual/en/function.scandir.php

    Then just run a foreach on the returned array and echo <option> for each one.

    0 讨论(0)
  • 提交回复
    热议问题