Nu ma gandeam ca prea multa lume din cercul meu stie de konami code.
De obicei apare melodia de rickroll cand introduci codul, dar era un cliseu prea mare nu?
Eu l-am invitat pe John Cena sa ne incante!!!!!!!!!
Since Php 5.4, the /e modifier in preg_replace function has been deprecated and thus the code which uses this modifier should be modified or it will stop working. How can you do that? Simple. Let’s look on the source code of mPDF. We have the following:
$html = preg_replace(‘/\{DATE\s+(.*?)\}/e’,”date(‘\\1’)”,$html );
What this does is replacing for example {DATE d-m-y} with the PHP function of date(‘d-m-y’). We should modify this line as we can see it uses the /e modifier and it won’t work anymore on php 5.5. To replace it, we use the preg_replace_callback function like this:
$html = preg_replace_callback(‘/\{DATE\s+(.*?)\}/’,create_function(‘$matches’, ‘return date($matches[1]);’),$html );
Or even better using PHP 5.5 standards:
$html = preg_replace_callback(‘/\{DATE\s+(.*?)\}/’, function($matches) { return date($matches[1]); },$html );
What this does is that it creates a anonymus function and returns the date() function with the matches.
So, the alternative method to the /e modifier is to use the preg_replace_callback function in Php 5.5 or 5.4.
Salutare, bine ati venit pe blogul lui Tata! Sa stiti ca aici nu o sa gasiti desene, v-am avertizat!
Iosua Pacurar
Multumim pentru ca ne-ati facut tineretea mai frumoasa... Erau vremuri grele si nu ne permiteam sa cumparam CD-urile artistilor ,…