Page 1 of 1

Php function's error

Posted: Sun Feb 18, 2007 3:52 pm
by user___
Hi guys,
I have a function, which is very simple and I do not know why it does not work.

Code: Select all

function _sample($input_arr = array()) {
$i = 0;
$keys_arr = array_keys($input_arr),;

if(is_array($input_arr) && count($input_arr)>0) {
   foreach($input_arr as $k=>$v) {
   $this->output_arr = array($keys_arr[$i] this->escape_str($v, $get_magic_quotes_state));
   $i++;
   }
}
else {
   $this->output_arr = $input_arr;
   }
}
It does not set $this->output_arr in the class. I mean $this->output_arr is empty while it is not private. I tried it with array_values as it is done above but in a slightly different way and it did not work.
Ahy suggestions?

Posted: Sun Feb 18, 2007 4:41 pm
by feyd
You have a parse error on the line where output_arr is assigned.