Re: [PHP] Self generating variables/arrays
- From: ceo@xxxxxxxxx ("Richard Lynch")
- Date: Sun, 26 Nov 2006 22:01:27 -0600 (CST)
On Sun, November 26, 2006 3:45 pm, jekillen wrote:
1. one large array exploded around \n
2. then a loop looks for '<br><br>\n' items
and records the index number of these items
as well of keeping a count: ($c)
3. Since $c is a variable it can represent a different
number each time.
4. Since I don't know what $c is going to be I can't
declare array variables with predetermined names
You don't NEED to track the number of items:
PHP is happy to do that for you:
$a[$i][] = "next item";
5. I want to slice the large array into $c arrays that
begin and end around items in the large array
containing '<br><br>\n';
This is as much abstraction as I can give you
In context it is represented by several hundred lines of function
code.
I strongly suspect that you could simplify your code to a large degree...
Post a small "slice" out of your data and see what folks think.
You may be taking a very long route to your destination...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
.
- References:
- Self generating variables/arrays
- From: jekillen
- Re: [PHP] Self generating variables/arrays
- From: Stut
- Re: [PHP] Self generating variables/arrays
- From: jekillen
- Self generating variables/arrays
- Prev by Date: Re: [PHP] Negative memory_get_usage() Values
- Next by Date: RE: RE: PHP and XML
- Previous by thread: Re: [PHP] Self generating variables/arrays
- Next by thread: Re: [PHP] Self generating variables/arrays
- Index(es):