foreach ($your_array as $key => $value)
{
print ($key . " " . $value . "<br />");
}
That will accomplish the same thing, printing the key and the value. Putting the data in the key is the WRONG way to do this.
Anyway, loop through the array and unset() values you dont' want in the array.
foreach ($your_array as $key => $value)
{
if (!$value)
{
unset ($your_array[$key]);
}
}