php - Read in all the files in a particular directory displays the file names in a html list -


Reading all the files from a particular directory and displays the file name / link in an html list.

  • File name 2
  • file name 3 (file ext: .pdf) I'm seeing something like output:
    • File name 1 <

      My code:

        & lt; Ul & gt; & Lt ;? Php $ dir = '/ my_directory_location'; $ Files = scandor ($ dir); Forex Currency ($ files as $ INDILE) {? & Gt; & Lt; Li & gt; & Lt; A href = "& lt ;? php echo $ dir." / ". $ Ind_file ;? & gt;" & Gt; & Lt ;? Php echo $ ind_file ;? & Gt; & Lt; / Li & gt; & Lt ;? Php}? & Gt; & Lt; / Ul & gt;   

      Thank you in advance

        & lt ;? Php foreach (globe ("* .pdf") as $ filename) {echo "$ filename 
      "; }

      Output:

        resume1.pdf resume4.pdf resume5.pdf    

  • Comments

    Popular posts from this blog

    python - how we can use ajax() in views.py in django? -

    matlab - Using loops to get multiple values into a cell -

    python - Sequence Pattern recognition with Pybrain -