[PHP] Input field array ends up as "Array" string
Hi every body. I have a form that was originally working just fine. It had a series of input checkboxes with the same name ("interests[]"). These values then ended up in an array ($_POST['interests']), which I then imploded into a comma separated list ($interests = implode(', ', $_POST['interests']); ). Well, that was working just fine until yesterday when I started getting an error on that implode function ("Bad arguments to implode()"). So I did a "gettype" on $_POST['interests'] and it revealed that it is now ending up as a "string" variable. So I printed it and it contains the string "Array"! Anyone know what's going on here? Thanks --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Input field array ends up as "Array" string
Well, in the process of pulling out some code into a sample page to send to the list I found the problem. It was yesterday when someone who was testing it told me about the problem, but the problem must have been going on for a week, because a week ago I added code to a global include script that checked to see if magic quotes was on and then did a stripslashes on all the values in $_POST if they were. So that ended up doing a stripslashes on the string "Array" and replacing $_POST['interests']. So I expanded the routine that striped the slashes so that it checks first to see if the element is an array. Cheers --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php