I have one cycle while:
while ($userEquipments = mysql_fetch_array($getUserEquipments))
and in this cycle have one if with arrays:
if ($userEquipments['cloth_id'] == $clothes['id'] && $userEquipments['cloth_is_used'] == 1)
$isUsed = array('cloth_type' => $clothes['type_cloth'], 'cloth_name' => $clothes['name'], 'cloth_image' => $clothes['image']);
My question is how to return all information in this arrays?
You should declare your array outside your while, this way you can access it outside the loop.
Try this:
$isUsed[];
while ($userEquipments = mysql_fetch_array($getUserEquipments))
{
if ($userEquipments['cloth_id'] == $clothes['id'] && $userEquipments['cloth_is_used'] == 1)
{
$isUsed['cloth_type'] = $clothes['type_cloth'];
$isUsed['cloth_name'] = $clothes['name'];
...
break;
}
}
// Print the array
print_r($isUsed);