Fatal error: [] operator not supported for strings 报错解决办法

Fatal error: [] operator not supported for strings 报错解决办法
<?php
$data=array('title'=>'php教程网','content'=>'php教程网','time'=>'2015/4/9');
$data['time'][]='2015-4-9';
print_r($data);
/*
报错致命错误:[]操作符不支持字符串类型
Fatal error: [] operator not supported for strings
*/
?>

Fatal error: [] operator not supported for strings 报错解决办法
对变量进行初始化操作
<?php
$data=array('title'=>'php教程网','content'=>'php教程网','time'=>'2015/4/9');
$data['time']=array();
$data['time'][]='2015-4-9';
print_r($data);

?>