Why exactly is the whole $result thing there followed by that foreach loop? To me it seems like the $handle is just reconstructed. And what does the percentage signs mean?