Finding a value in an array
| From: | charles kline | Date: | Fri, 23 Jul 2004 03:34:56 +0000 |
| Subject: | Finding a value in an array | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191603@lists.php.net to get a copy of this message | ||
Hi all,
I am using fgetcsv() to get a tab delimited text file into an array. It gives me an array in this format:
Array
(
[0] => Array
(
[0] => 97
[1] => Effects of Slow Heating Rates on Products of Polyethylene Pyrolysis
)
[1] => Array
(
[0] => 103
[1] => Effect of Heating Rate of Oxidative Degradation of Polymeric Materials
)
[2] => Array
(
[0] => 106
[1] => Identification and Differentiation of Synthetic Polymers by Pyrolysis Capillary Gas Chromatography
)
)
From a form, I am passing in some values from checkboxes like:
<input type="checkbox" name="notes[]" value="97" />
<input type="checkbox" name="notes[]" value="106" />
I need to be able to display the description string in the array for whichever checkboxes are checked. So for example if the user submits the form with the value "106" I want to display "Identification and Differentiation..."
Any ideas? Please copy me on replies.
Thanks,
Rogue