04-09-2021, 03:37 AM
@iRedds,
Should I use function(&$array) here in my code?
Should I use function(&$array) here in my code?
PHP Code:
use CodeIgniter\Events\Events;
Events::on('add_value_to_array', function(&$array) {
error_log("add_value_to_array" . PHP_EOL, 3, "events.txt");
array_push($array, "new");
return $array;
});