Clearing PHP Array at starting of iteration

1st iteration

$dat[]=array_fill(1,10,NULL);

echo $dat[1];          //nothing printed 

$dat[1]="pattern";
$dat[2]="subject";

2nd iteration

$dat[]=array_fill(1,10,NULL);
echo $dat[1];     //prints pattern

in the second iteration if $dat[1] is not stored with any value, then i want this to be empty!
i tried storing dat[1] with $dat[1]=" " but it becomes an array with length 1 hence in the second iteration if i store $dat[1]=“some” then only “s” gets stored in to that…

Read this maybe it helps array_fill help

i figured out, it was treating like arrary of an array i guess…
its working now…