Thursday, 8 October 2020

PHP fill array with dummy content, 4X faster than loop and 4X less memory

 use array_fill():

$t = array_fill($start_index, $index_index, 'val');

https://stackoverflow.com/questions/3506773/fill-array-with-values-without-loop-in-php

No comments:

Post a Comment