• CSC 363 Lab #4 - PHP Lab #1:
  • Due Date May 29th :  due dates will be in the Task list in Blackboard
  • Practice with PHP arrays and program loops
  • 50 points distributed as follows:

Create a  PHP page, which defines an array as follows:

$fruit_list= array ("apple","orange","apple","bannana","orange","pear" ,"grape","apple","kiwi fruit","strawberry");

  1. Include as your page title: PHP Lab #1
  2. Include a level 1 heading with your Name or at the top of your page.
  3. ln a level 2 heading print out the number of elements within the array.  You should not hard code this number but use one of the PHP functions to access this count sizeof Alias of count()
  4. Your program should then loop  through the array printing out the contents, where each array entry is displayed within one cell of an HMTL table.
  5. Outside your first table, display a heading, indicating the contents of the array will be sorted then displayed again in a new Table.
  6. Sort the table then again loop  through the array printing out the contents, where each array entry is displayed within one cell of an HMTL table.
  7. Place a hyperlink back to your course home page at the bottom of this page.
  8. Additionally the tables you display should have a background color other than the default white or gray.


  9. Publish your page on the profhicks.com server account space, and place a link to the page from your course home page.
     
  10. When you view a php file in a browser, what you see is the html code generated by the php code.  Because of this, I would like you to submit  your php page in Blackboard in addition to uploading it to your profhicks server space.  (Upload the phpLab1.php file in Blackboard just like you submit your C++ programs in Blackboard.  You do not need to upload your  html page in blackboard, but of course you do need to upload both files to your profhicks web server space.)    

    Task Points Description
    A
    2
    Browser title bar should read PHP Lab #1
    B
    2
    Level 1 heading with your name at the top of this page.
    C
    8
    Level 2 heading print out the number of elements within the array using PHP function.
    E
    12
    Your program prints out the contents of the array, where each entery is displayed within one cell of an HMTL table
    F
    4
    You sort the array contents.
    G
    14
    In a new table, your program prints out the contents of the sorted array, where each entery is displayed within one cell of an HMTL table.
    H
    4
    The HMTL tables you produce use a background color other than the default .
    I
    2
    You include a hyperlink back to your course home page at the bottom of this page.
    J
    2
    You upload your php file,  phpLab1.php  to Blackboard
     
    50
    Total

    [top]