Как сделать петлю?Ну, есть несколько способов ...
#1...
foreach ($embed as $e) {
#do stuff with $e as the current item
}
#2...
$len = count($embed);
for ($i = 0; $i < $len; $i++) {
#do stuff with $embed[$i] as the current item
}
#or, with a while loop
#3...
while ($len--) {
#do stuff with $embed[$i] as the current item
}