I'm not too experienced with PHP, but I'm trying to create a small program that will utilize a class schedule and print out statements based on what time each class is, etc.
Here is my program that I have a question about:
class Period {
public $name;
public $times = array(); //Ideally, whatever is inputted here will be an array.
public function __construct($name, $times) {
$this->name = $name;
$this->times = $times;
}
}
$A_Block = new Period("AP Graphic Design", ("Day 1"=>"8:20", "Day 2"=>"11:35", "Day 4"=>"2:10", "Day 5"=>"10:20","Day 7"=>"1:10"));
I have the period class with two attributes, a simple name string, and an associative array (dictionary) of times that the class occurs. During the initialization of $A_Block, something is wrong with how I'm creating the array.
What will I need to change in my Period class in order to be able to create the A_Block class with the associative array?
Thanks!