Hi There, I have the following code:
two arrays:
$user_body_group & $DB_Seconday_muscles
I want to look up the "$DB_Seconday_muscles" Array and search for the elements in the "$user_body_group" array
The result would be displaying a checkbox list with only the items in the "$user_body_group" array checked:
foreach($DB_Seconday_muscles as $value) {
echo "<input name=\"colors[]\" type=\"checkbox\" value=\"$value\"";
if (in_array($value,$user_body_group))
{
echo "CHECKED";
}
echo "> $value ";
}
BUT... When i run thi script i only get the first element in the searched array ticked.
Can anyone help!
Many Thanks!
Leatfield