Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 26th, 2003, 05:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default 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
__________________
www.campusgrind.com - college portal
Reply With Quote
  #2 (permalink)  
Old July 28th, 2003, 06:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old April 7th, 2016, 01:16 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 2dimention arrays and grids

How do i assign values in a grid I.e row an column
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help With Arrays Crippy Ruby 2 March 6th, 2013 04:59 PM
arrays ozPATT Excel VBA 2 November 4th, 2005 05:11 AM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 02:42 PM
Arrays tajin Excel VBA 0 June 20th, 2004 09:07 AM



All times are GMT -4. The time now is 04:38 PM.


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