Skip to main content
Inspiring
May 26, 2006
Question

PHP Array Help Please - Seaching Arrays - Array Filter

  • May 26, 2006
  • 3 replies
  • 305 views
I need a tutorial looked at if anybody has the time. I"m learning how to
search multidimensional arrays and I want to ensure that I don't start off
with a bad tutorial.

http://www.desilva.biz/arrays/filter.html Is what I am currently looking
at. It looks like it will do what I'm trying to attempt, but as I'm still
so new to PHP....

I'll post back with my results, because I'm sure I'll have follow-up
questions.

--

Thank you,

Jon Parkhurst


This topic has been closed for replies.

3 replies

Inspiring
May 30, 2006
;o) Thanks David. That's exactly what I was looking for. What a great
Monday!

Jon

"David Powers" <david@example.com> wrote in message
news:e57u5k$ngm$1@forums.macromedia.com...
> crash wrote:
>> Can I not put a while inside an array statement?
>
> No. When using a loop, you can add new items to an array with
> array_push():
>
> www.php.net/manual/en/function.array-push.php
>
> --
> David Powers
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> http://foundationphp.com/


Inspiring
May 26, 2006
crash wrote:
> Can I not put a while inside an array statement?

No. When using a loop, you can add new items to an array with array_push():

www.php.net/manual/en/function.array-push.php

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Inspiring
May 26, 2006
OK.

I'm getting the following error on this code, if anybody can take a quick
look. It's from the tutorial I posted, which seems to be exactly what I'm
looking for. I think it's just my PHP notation that is off right now.

What I am attempting to do is create array, $mcGroups which contains
several arrays that link the Group to the Level of clearance, for all
records in the recordset rsGroupAccess.

Can I not put a while inside an array statement? Can anybody suggest a
means to accomplish what I'm looking for?

$mcGroups = array(
do {
$rsGroupAccess['gaGroup']=>array(
$rsGroupAccess['gaLevel'])
} while ($row_rsGroupAccess = mysql_fetch_assoc($rsGroupAccess));
);