Re: Fixing new problems due to deprecations ...
| From: | Kalle Sommer Nielsen | Date: | Mon, 28 Sep 2015 16:54:41 +0000 |
| Subject: | Re: Fixing new problems due to deprecations ... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325144@lists.php.net to get a copy of this message | ||
2015-09-28 18:49 GMT+02:00 Lester Caine <lester@lsces.co.uk>:
>> - 'sort'=>preg_replace('/([0-9]+)/e',
>> 'substr("000000000\\1", -10)', $value)
>> + 'sort'=>preg_replace_callback('/([0-9]+)/', function ($match) {
>> return substr("000000000$match", -10); }, $value)
Without looking at the documentation, and just reading the error and
some common sense, then $match would be an array and when used in
interpolation, it would be converted to a string. So it is likely you
would need to reference a specific index in the $match array for it to
work. like: "000000000{$match[???]}"
--
regards,
Kalle Sommer Nielsen
kalle@php.net