extrovertive Posted August 19, 2006 Share Posted August 19, 2006 without the use of a for-loop.Is there a built-in function for this? Like I know for strings, I can use str_repeat...but what about arrays? Link to comment https://forums.phpfreaks.com/topic/18018-filling-an-array-with-all-0s/ Share on other sites More sharing options...
Barand Posted August 19, 2006 Share Posted August 19, 2006 http://www.php.net/array_pad Link to comment https://forums.phpfreaks.com/topic/18018-filling-an-array-with-all-0s/#findComment-77163 Share on other sites More sharing options...
Daniel0 Posted August 19, 2006 Share Posted August 19, 2006 [code]<?php$array = array_fill(0,9,'0');?>[/code]Will make ten keys with the value 0. Link to comment https://forums.phpfreaks.com/topic/18018-filling-an-array-with-all-0s/#findComment-77175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.