RE: populate form input option dropdown box from existing data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17 June 2009 15:01, PJ advised:

> It does, indeed. This confirms my inexperienced conclusion that
> in_array() does not work on associative arrays per se; it works on
> simple arrays and I just don't have the experience to think of
> extracting only the id fields.

Let's squash this misconception again -- PHP only has associative
arrays, it's just that in most contexts it treats numeric keys
specially. So, internally, array('fred', 'bill', 'joe') is stored using
exactly the same techniques as array('one'=>'fred', 'two'=>'bill',
'three'=>'joe'), but because the first one has numeric keys there are
some things you can do with it that you can't with the second.  But
functions such as in_array, where all that really matters is the array's
values, really couldn't care whether the keys are numeric, string, or a
mixture.

> Also, the other problem was the option selected definition required
> Shawn's clarification <select name='component-select' multiple ...
which
> now highlights the selected fields. In all my searches (horrendously
> wasted time) I did not find 
> any mention
> of "component-select" either in php.net or w3c.org

I totally don't understand this comment: 'component-select' is just the
name that Shawn chose to give his <select> field -- he could just as
well have named it 'arnold-frog' without it making a blind bit of
difference (so long as every other reference to it was changed to
match!).

Cheers!

Mike

 --
Mike Ford,  Electronic Information Developer,
C507, Leeds Metropolitan University, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom
Email: m.ford@xxxxxxxxxxxxxx
Tel: +44 113 812 4730


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux