from array to function argument

hi,
i have a little problem this my validation class:

[php]// IMPLEMENTATION validate field… $a -> validate_all (
array( ‘valid_email’ => $_POST[‘field1’], ‘valid_url’ => $_POST[‘field2’],
‘valid_lenght’ => array( $_POST[‘field2’], 100 ) );[/php]

[php]// public function valid_length( $val, $max ){
public function validate_all( $values ) {
foreach( $values as $check => $value ) {
if( is_array( $value ) ) { // check for multidimensional array
for ( $i = 0; $i < count( $value ); $i++ ){ $value2 .= $value[$i] . “,”; }
$value2 = substr( $value2, 0,-1);
if( !$this -> $check ( $value2 ) ) { return false; } // function arguments should be passed in $value2
[/php]

the output of $value2 is right, but print missed argument 2 error :o

i think the function arguments are passed as string instead of arguments

how i can do? ???

thank you very much for your help

Sponsor our Newsletter | Privacy Policy | Terms of Service