PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 4th, 2012, 07:53 AM
Gizz Gizz is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Gizz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 50 m 10 sec
Reputation Power: 0
Question General - Dynamically create array name holder

Hi, is it possible to dynamically create an array name holder

I have the following:

Code:
while ($row = mysql_fetch_array($results_select_events)) {
		if ($build_month_events_array_counter == 0){
		$month1_array[] = $row;
		}
		if ($build_month_events_array_counter == 1){
		$month2_array[] = $row;
		}
		if ($build_month_events_array_counter == 2){
		$month3_array[] = $row;
		}
		if ($build_month_events_array_counter == 3){
		$month4_array[] = $row;
		}
		if ($build_month_events_array_counter == 4){
		$month5_array[] = $row;
		}
		if ($build_month_events_array_counter == 5){
		$month6_array[] = $row;
		} etc etc etc 


but was wondering if it's possible to do something like:
Code:
$month.$build_month_events_array_counter_array[] = $row;

This would reduce the code by creating the array name incremented by the counter!

I have tried but cannot get working - please any help appreciated

Reply With Quote
  #2  
Old December 7th, 2012, 12:39 AM
Jones21 Jones21 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 8 Jones21 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 42 sec
Reputation Power: 0
very well




Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > General - Dynamically create array name holder


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap