Fixing new problems due to deprecations ...

From: Date: Mon, 28 Sep 2015 16:49:54 +0000
Subject: Fixing new problems due to deprecations ...
Groups: php.general 
Request: Send a blank email to php-general+get-325143@lists.php.net to get a copy of this message
preg_replace /e deprecated so I put the fix I had in ... > - '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) ERROR 8: Array to string conversion 0 Error occurred on line 440 of file class_gedcomrecord.php in function {closure} 1 called from in function preg_replace_callback It's buried several thousand lines into an import routine but it's not the first time I've been hit by the match returning an array rather than a single entry. Can someone point me to the 'modern' way to handle this rather than just switching off the deprecated warnings :) -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

« previous php.general (#325143) next »