PHP: Multidimensional Arrays II

Derek Bridge

Department of Computer Science,
University College Cork

PHP: Multidimensional Arrays II

Aims:

Class exercise

Rectangular arrays

Ragged arrays

Class exercises

  1. Write a PHP script that outputs Donna's grades as nested unordered lists, as follows:
    • WC1101
      • 85
      • 0
    • WC1102
  2. Write a PHP script that outputs Donna's grades as a table. Make all rows in the table the same length by 'padding' them with cells that contains hyphens (<td>-</td>), as follows:
    WC110185000--
    WC1102727591603435
    WC11035757575757-