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? Quote Link to comment Share on other sites More sharing options...
Barand Posted August 19, 2006 Share Posted August 19, 2006 http://www.php.net/array_pad Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.