![]() |
arrays
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; thanks the genuine genius |
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: http://www.php.net/manual/en/function.array-shift.php http://www.php.net/manual/en/function.array-push.php |
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 07:04 PM. |
Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.