A more canonical version when using an array with a for loop would be:
for ($i = 0; $ i < count($values); ++$i) {
// do stuff with $values[$i] here...
}
Though perhaps a foreach loop is better:
foreach ($values as $value) {
// do stuff with $value here...
}