Answer the question
In order to leave comments, you need to log in
Is it possible to replace calls to an array with its values in PHP?
There is an array with a whole bunch of cells that is called in order throughout the program, that is, mass[1], mass[2] ... mass[500]. Is it possible to somehow quickly change all these calls to cell values?
Answer the question
In order to leave comments, you need to log in
$GLOBALS['GLBL'] = array(
base64_decode('c3RyX3Jlc' . 'G' . 'xhY2U='),
base64_decode('ZmlsZV9nZXR' . 'f' . 'Y' . '29udGVudH' . 'M='),
// ...
);
$content = <<<'FILE'
<содержимое файла>
FILE;
echo preg_replace_callback('/\$GLOBALS\[\'GLBL\'\]\[(\d+)\]/m', function ($m) use ($GLOBALS) {
return $GLOBALS['GLBL'][intval($m[1])];
}, $content);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question