How to implement class methods in array_map’s callable [duplicate]

You are specifying dash as the callback in the wrong way.

This does not work:

$this->classarray = array_map($this->dash(), $data);

This does:

$this->classarray = array_map([$this, 'dash'], $data);

Read about the different forms a callback may take here.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)