$num_parts = count($part) - 1;

for ($i = 0; $i <= $num_parts; $i++)