4:32 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re[3]: [PHP] split array in 2 halfs
$smallarray1=array_slice($bigarray,0,3);
$smallarray2=array_slice($bigarray,3,3);
On Wed, 31 Oct 2001 23:25:55 -0800, Daniel Harik wrote:
>Want to split it in half
>
>1 Big array:
>
>1
&g
Don't forget that you should clear out that memory space, especially if it's
an array of arrays or an array of objects or something along those lines:
unset($bigarray);
Just good programming practice, that's all. I doubt it would ever be a
problem on today's servers, but it's still a good idea.
$smallarray1=array_slice($bigarray,0,3);
$smallarray2=array_slice($bigarray,3,3);
On Wed, 31 Oct 2001 23:25:55 -0800, Daniel Harik wrote:
>Want to split it in half
>
>1 Big array:
>
>1
>2
>3
>4
>5
>6
>
>Want to make
>
>
>1 Small array:
>
>1
>2
>3
>
>2 Small array:
>4
>5
>6
>
>Thank You
>
>
--
M
3 matches
Mail list logo