Jump to content

arrays, from to....


mkosmosports

Recommended Posts

A few ways...

[code]<?php

// fill an array with numbers 0 to 699 (700 elements)

$my_array = range ( 0, 699 );

print_r ( $my_array );

// create an array with keys 0 - 699 (values set as empty )

// array_fill starts at 1, so we add + 1 to start and ending values

$my_array = array_slice ( array_fill ( 1, 700, '' ), 0 );

print_r ( $my_array );

?>[/code]


Link to comment
https://forums.phpfreaks.com/topic/27214-arrays-from-to/#findComment-124427
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.