Reply to Re: Array troubles

Your name:

Reply:


Posted by Steve on 08/24/07 04:05

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:lPudnec_iOnQpVPbnZ2dnUVZ_o7inZ2d@comcast.com...
| Steve wrote:
| > "Kyote" <kyote_love@nospamhotmail.com> wrote in message
| > news:96csc3tplg3md00t969hu45f74dt6bb80u@4ax.com...
| > |
| > | >$books = array();
| > | >foreach ($files as $value) {
| > | > $c = substr($value,0,1);
| > | > if (!is_array($books[$c]))
| > | > $books[$c] = array();
| > | > $books[$c][] = $value;
| > | >}
| > |
| > | Thank you very much Jerry. This seems to work exactly as I need.
| >
| > jerry's got it...but just a tid-bit of fun...
| >
| > a string is an array of characters. so, $c could easily be set by:
| >
| > $c = $value[0];
| >
| >
|
| That's true - just trying to keep it close to what he had. Didn't want
| to cornfuse him too much :-)

i know...it's one of those 'i never knew that' things. since you covered the
answer just fine, i thought i'd give the 'one to grow on'. after i posted
that, i was overjoyed to see rik had actually done the same thing in his
example.

hey, bet you two bits the op is processing flat files and the first
character of each line is the record type. ;^)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация