Re: [PHP] Self generating variables/arrays



# jekillen@xxxxxxxxxxx / 2006-11-25 22:19:05 -0800:
Hello;
I am writing some code that will format results of a search for display.
I need to split an array into several different arrays but I won't know
before hand how many, so, I am looking for a way to dynamically
generate arrays for this purpose.
My present direction is to use the following code:

for($i = 0; $i < $c; $i++)
{ eval('$a_'.$i.' = array();'); }

what's wrong with:

for($i = 0; $i < $c; $i++)
{ $a[$i] = array(); }

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991
.



Relevant Pages

  • Re: Java script help
    ... you are talking about UI (user interface). ... HTML element of some kind. ... Do you want to "display" the text in the page as ... How would you keep both arrays in ...
    (microsoft.public.frontpage.client)
  • Displaying a section of a graph.
    ... I am getting data from a device on a USB bus and building time and data ... display on a XY graph. ... I tried selecting a subset of the data and time arrays with the zero indices ...
    (comp.lang.labview)
  • Re: Access one character in an array of characters
    ... > points but also display the cards of a particulier hand by suit. ... > To print out the values by rank I have used this while loop sequence: ... > the loop works it would display any character that is not the null ... raw arrays is not the 'OO way'. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Java script help
    ... You say you want to "display" text. ... > I am trying to understand how Java script works. ... > separate arrays. ... For the purpose of this example, I want the arrays to be separate. ...
    (microsoft.public.frontpage.client)
  • Re: sharing information in a class
    ... >> you cannot put those arrays inside the CreateShape method, ... For instance this is how you Circle class should look ... float GetAreaconst; ... The Display method doesn't take all those incorrect parameters, ...
    (comp.lang.cpp)