- Output for 5.4.0 - 5.4.22
- Parse error: syntax error, unexpected '}' in /in/c6bHK on line 11
Process exited with code 255. - Output for 5.3.0 - 5.3.27
- Parse error: syntax error, unexpected '[' in /in/c6bHK on line 7
Process exited with code 255.
<?php
$code = "[gallery-1] <p>Test...test...test...</p> [gallery-2]";
preg_match_all("/\[gallery-([1-9])\]/", $code, $matches);
$galleries = [];
foreach ($matches[1] as $id) {
$galleries[$id] = // Somehow load a gallery basing on id;
}
foreach ($galleries as $id => $code) {
$code = str_ireplace("[gallery-" . $id . "]", $code);
}
echo $code;