PHP Lab

Do each of the following one by one each in order on a single webpage,
after each of instructions 1-11 are complete

LOAD THE PAGE & FIX ANY OBVIOUS ERRORS BEFORE CONTINUING

  1. Write a php loop to generate all numbers from 0 to 18.
  2. Write a second php loop to generate all numbers from 0 to 18 with a leading zero for all those values less than 10.
  3. If you haven't already done so, make sure each of the above loops contains an echo (or printf) so that each generated value is printed one per line.
  4. Download the provided "tar file" of images: banner284_files.tar and store it somewhere in your html folder or a subfolder!

    Unpack it on command line with...

                 tar xvf banner284_files.tar 

    Do not modify this folder.
    Do not add or remove files from this folder or change any file or folder name.

    Go back to your php file and add the following....

  5. Add a horizontal rule to the bottom of your displayed paged of php stuff.
  6. Write a 3rd php loop that generates an html img display line for each file in the downloaded folder. Images should appear UNDER the horizontal rule you added.
  7. Add another horizontal rule to the new bottom of your displayed paged of php stuff.
  8. Now make a 4th php loop that does the same as the last loop but is located inside a function. Call that function & make sure all images appear again.
  9. Add another horizontal rule to the new bottom of your displayed paged of php stuff.
  10. Now make a new function that takes as parameters both the beginning and ending number of the images you want to display out of the banner284_files folder. Call that function & make sure appropriate images appear.
  11. Go read/re-read php chapter(s) and ... try stuff out.