Validate multi-dimensional arrays using dot syntax and asterisks
masterValitron supports dot notation to access nested array members. You can use an asterisk (*) to apply a rule to every element in an array or every element within a nested array.
// Validate threshold in nested settings array
$v = new Valitron\Validator(array('settings' => array(
array('threshold' => 50),
array('threshold' => 90)
)));
$v->rule('max', 'settings.*.threshold', 100);
// Validate all members of a numeric array
$v = new Valitron\Validator(array('values' => array(50, 90)));
$v->rule('max', 'values.*', 100);
// Access nested values using dot notation
$v = new Valitron\Validator(array('user' => array('first_name' => 'Steve', 'last_name' => 'Smith', 'username' => 'Batman123')));
$v->rule('alpha', 'user.first_name')->rule('alpha', 'user.last_name')->rule('alphaNum', 'user.username');