SyntaxFix
Write A Post
Hire A Developer
Questions
There is also array_pad. You can use it like this:
$data = array_pad($data,$number_of_items,0);
For initializing with zeros the $number_of_items positions of the array $data.