"Wouter Van Vliet" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > First of all, you said to use the first three values of the array for anoter > reason .. well the, what I'd do is this: > > $FirstThree = array_splice($_POST, 0, 3); > > Which will give you the first three elements of the array, and leave you > with a $_POST array you can do foreach with.
Great! Thanks! I think it will be very useful. > Second, to manually loop through an array, use: > http://nl.php.net/manual/en/function.prev.php > http://nl.php.net/manual/en/function.next.php > http://nl.php.net/manual/en/function.current.php > http://nl.php.net/manual/en/function.reset.php > http://nl.php.net/manual/en/function.end.php Yes, I know these functions, but I'm still wondering if there's a DIRECT way to move an array's internal pointer to a specific position and/or key. > Third, don't rely on the order your array elements are given to you by post > data. Rather just use foreach() and (ignore|do something else with) the > key-value pairs you don't want for this thing. But if these required three keys are messed up into the $_POST array, Is there a direct way to shift off elements at a specified key or index to remove them from an array? (I mean without a batch process) Something like: array_shift($array, $index) which of course is incorrect Although now I know I can write a code to search for a key and then splice it out from $_POST into another one. Thanks! > Fourth, I hope I'm not spoiling Jay Blanchard statement on how uncredibly > great this online PHP Manual is since you could probably find all the > answers to array related questions right here: > http://nl.php.net/manual/en/ref.array.php Thanks... I'm reading the online manual and many other sites before posting to newsgroups, As you can see, I'm not an expert programer but just a beginner. I'm trying to make a lightweight any-form-to-email script. The first 3 keys of the associative array ($_POST) are "recipient", "reply_email" and "subject". All other NAMED form elements will be mailed with this format: FORM NAME (key): FORM VALUE (value) - PhiSYS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php