0

I have a function which im not entirely sure how to convert it to get working in newest php

$eventSponsor = array_map(create_function('$o', 'return $o["id"];'), $event->sponsors);

which method should i use in newest php version ?

mactavich
  • 3
  • 2
  • 2
    Does this answer your question? [PHP 7.2 Function create\_function() is deprecated](https://stackoverflow.com/questions/48161526/php-7-2-function-create-function-is-deprecated) – JureW Feb 23 '21 at 06:34

1 Answers1

0

yeah i was searching and i found this method called anonymous function so the code be like

$awe function ($o) {
                return $o["id"];
            };

            $eventSponsor = array_map($awe,$event->sponsors); ```
mactavich
  • 3
  • 2