array_walk always passing 0 as the parameter
- From: Mike <mpearl1@xxxxxxxxx>
- Date: Tue, 22 May 2012 10:13:17 -0700 (PDT)
array_walk is passing (int)0 as the parameter every time. What am I doing wrong?
I have a method to clean data, FilterInput::clean($value,$type), which I'm calling. I need to pass it the variable and the type I expect it to be.
When array_walk calls the function, I pass the variable type ('string' or 'int') to the method, but when it get's there the parameter always =0.
My code:
$data = array();
$data[0] = array('A Value','Another Value','Different Value');
$data[1] = array('12345','54321','11223');
array_walk( $data[0], array('FilterInput','clean'), 'string' );
array_walk( $data[1], array('FilterInput','clean'), 'int' );
Thanks!
Mike
.
- Follow-Ups:
- Re: array_walk always passing 0 as the parameter
- From: Michael Fesser
- Re: array_walk always passing 0 as the parameter
- Prev by Date: Re: PHP Concatenate
- Next by Date: Re: array_walk always passing 0 as the parameter
- Previous by thread: PHP Concatenate
- Next by thread: Re: array_walk always passing 0 as the parameter
- Index(es):