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

    c - Mpirun hangs when mpi send and recieve is put in a loop -

    python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

    java - Unable to get JDBC connection in Spring application to MySQL -