p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP How-To (http://p2p.wrox.com/forumdisplay.php?f=98)
-   -   arrays (http://p2p.wrox.com/showthread.php?t=2120)

Moharo July 26th, 2003 05:40 PM

is there a function that will shift its values to different indecies?for example:

myarray = Array();
myarray[0] = 0;
myarray[1] = 1;
myarray[2] = 2;
myarray[3] = 3;

can be changed to:

myarray[0] = 1;
myarray[1] = 2;
myarray[2] = 3;
myarray[3] = 0;


the genuine genius

Daniel Walker July 28th, 2003 06:41 AM

array_shift and array_push should do this for you. The first will shift your elements up one, with the first element falling off the top of the list. Then array_push, can be used to push that element back on at the bottom.

In fact, PHP has a dizzying set of array functions:

Moloi Da Wizard April 7th, 2016 01:16 PM

2dimention arrays and grids
How do i assign values in a grid I.e row an column

All times are GMT -4. The time now is 05:34 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.