Brad Hubbard wrote:

> <?php
>         // Suck 'em in
>
>         $site = array (
>                 "section1" => 007,
>                 "section2" => 11,
>                 "section3" => 57.5,
>                 "section4" => 12,
>                 "section10" => 1
>         );

    Okay, this answer the first part of my question.  How would I go about
checking variables against that array?  I need to know if the contents of a
variable $section exists in the array, and if so, if the contents of the
accompanying variable $page is not negative, and less or equal to the INT
value of that $section.

    In a different language I can write something that will return the index
of $section in the array, then I can use that index value to fetch the INT
afterwards:

    $array = {{"section1", 1},{"section2",4},{"section3",2}}
    if (idx = ($section in list_iassoc($array, 1))) => 1 being the
                                                       first element
      // idx[1] = "section#"
      // idx[2] = INT
      if ($page > 0 && $page =< $array[idx][2])

    etc.



--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to