What are you trying to do here? Just what exactly do you mean by making it dynamic? Do you want the data be created on the fly? or Do you want dynamic memory allocation in PHP?
The array you constructed is a mutidimensional array of associative arrays (i.e. an array of hashes).
If making it dynamic, you mean getting the data somewhere and adding it to the array
Code:
$a = array(); // Create an empty array of hashes
while(<not eof>)
{
// read details from file ...
...
// create an array and populate associative values ...
$b = array(
'id' => 1,
'title' => "Event1",
'start' => "$year-$month-10",
'url' => "http://yahoo.com/");
// Add to the list
array_push($a, $b); // Same as $a[] = $b;
}
...
json_encode($a);
...
echo json_encode($c);
[/code]