. . . .
public $counts_per_page = 15;
public function getNames($user_id, $count = $this->counts_per_page){
//do stuff
}
. . . .
I am getting an error on second parameter as it doesnt allow me to do this…
Parse error: syntax error, unexpected T_VARIABLE in
how can i solve this?Thanks in advance.
From the php manual:
http://php.net/manual/en/functions.arguments.php
You can set it to null or some other default instead and then check for that within the function.