So I thought this would be easy, but try as I might various methods of appending values to an array in PHP, I always get NULL.
$sites = array();
$sites[0] = $_POST['site0'];
foreach($sites as $site) {
var_dump($site);
}
$_POST['site0'] is an HTML form array, containing 11 keys and values. I get a invalid argument error for line 3. Any reason why this would occur?
null, but are you sire_POST[site0]is set?$arr[] = 'new item'; specify more dimensions depending on structure as needed e.g.$arr[0][] = .... It makes no sense at all thatvar_dumpwould printnullwith the above code. Is that what you really have?var_dump($_POST['site0'])this code?foreach($sites as $site)gives me "invalid argument". There are going to be more sites, and I'd like to cycle through and process them.