Jump to content

'explode' in a loop


cliftonbazaar

Recommended Posts

I wanted a 2 dimensional array of information for a game I was building but found out on the Internet that it could not be 'imploded' into a database.

 

So i made 12 arrays, one for each player, instead of a team array $team[12][31].

 

Now when I goto explode it I thought I would go through a loop

	  //for($line_up=1; $line_up < 12; $line_up++)  {
    $playerArray.$line_up = explode(",", $match[$homeTeam.$line_up]);  //Get the player from the database
  }  	

the loop breaks as soon as it completes the first explode.  I found out this the easy way by putting

echo "$line_up";

in the loop and it only showed up once when run; comment out the explode line and the echo $line_up shows 1-12 (as it should).

 

Is there any way around this or a better way?

Link to comment
Share on other sites

Explain what data you need to store and we might be able to help you with a better design.

Each team has about 35 statistics and anywhere from 16-25 players; each player has 31 statistics.  My design currently is to have each player as an array of their own stats.

 

If someone can help me with the explode loop problem that would allow me to keep going in this area; if another design concept is suggested then i would welcome it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.