I have the following code:
for ($grouped = 0; $grouped < $sizearray; $grouped++){
$manymails = sizeof($POST["email"][$grouped]);
echo $manymails;
for ($loop = 0; $loop < $manymails; $loop++){
echo $POST["email"][$grouped][2];
echo '<input type=hidden value="'.$_POST["email"][$grouped][$loop].'" name="emailarray['.$countrows.']">';
$countrows += 1;
}
}
The POST variable email has the following entry for example
because it comes from checkboxes
$POST["email"][1][2] contains for example daniel@imcworld.com
$POST["email"][1][0] doesnt contain anything.
the code above tries to return $POST["email"][1][0]
but what i am looking for is $POST["email"][1][2]
how can i check which is the last element of an array that contains a string and then with an if, exclude all elements
which do not include a string/content
thank you