rndilger
11-06-2007, 01:05 PM
Hello, I'm stuck on an array problem. I have the following array of session vars from a user form:
$quantity = array(1 => $_SESSION['a2dfam'], $_SESSION['a2dind'], $_SESSION['a2dstu'], $_SESSION['a1dfam'], $_SESSION['a1dind'], $_SESSION['a1dstu']
Note that not all of these values will be set (e.g., if the user didn't need to order something from each category). Therefore, on a verification page, I want to display totals only for the items that a user wants. You'll notice that the array values are in sets of 3 (family, individual, student).
Is it possible to loop through a set of 3 specific values in this array, determine whether ANY of those 3 are set, and if so, output specific code? I can't figure out how to search a subset of an array, and execute code if any of those values are present.
Thanks,
Ryan
$quantity = array(1 => $_SESSION['a2dfam'], $_SESSION['a2dind'], $_SESSION['a2dstu'], $_SESSION['a1dfam'], $_SESSION['a1dind'], $_SESSION['a1dstu']
Note that not all of these values will be set (e.g., if the user didn't need to order something from each category). Therefore, on a verification page, I want to display totals only for the items that a user wants. You'll notice that the array values are in sets of 3 (family, individual, student).
Is it possible to loop through a set of 3 specific values in this array, determine whether ANY of those 3 are set, and if so, output specific code? I can't figure out how to search a subset of an array, and execute code if any of those values are present.
Thanks,
Ryan