|
@@ 1255-1268 (lines=14) @@
|
| 1252 |
|
{ |
| 1253 |
|
$php_parts = preg_split('~(<\?php|\?>)~', $data, -1, PREG_SPLIT_DELIM_CAPTURE); |
| 1254 |
|
|
| 1255 |
|
for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++) |
| 1256 |
|
{ |
| 1257 |
|
// Do PHP code coloring? |
| 1258 |
|
if ($php_parts[$php_i] != '<?php') |
| 1259 |
|
continue; |
| 1260 |
|
|
| 1261 |
|
$php_string = ''; |
| 1262 |
|
while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != '?>') |
| 1263 |
|
{ |
| 1264 |
|
$php_string .= $php_parts[$php_i]; |
| 1265 |
|
$php_parts[$php_i++] = ''; |
| 1266 |
|
} |
| 1267 |
|
$php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]); |
| 1268 |
|
} |
| 1269 |
|
|
| 1270 |
|
// Fix the PHP code stuff... |
| 1271 |
|
$data = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode('', $php_parts)); |
|
@@ 1292-1305 (lines=14) @@
|
| 1289 |
|
{ |
| 1290 |
|
$php_parts = preg_split('~(<\?php|\?>)~', $data[0], -1, PREG_SPLIT_DELIM_CAPTURE); |
| 1291 |
|
|
| 1292 |
|
for ($php_i = 0, $php_n = count($php_parts); $php_i < $php_n; $php_i++) |
| 1293 |
|
{ |
| 1294 |
|
// Do PHP code coloring? |
| 1295 |
|
if ($php_parts[$php_i] != '<?php') |
| 1296 |
|
continue; |
| 1297 |
|
|
| 1298 |
|
$php_string = ''; |
| 1299 |
|
while ($php_i + 1 < count($php_parts) && $php_parts[$php_i] != '?>') |
| 1300 |
|
{ |
| 1301 |
|
$php_string .= $php_parts[$php_i]; |
| 1302 |
|
$php_parts[$php_i++] = ''; |
| 1303 |
|
} |
| 1304 |
|
$php_parts[$php_i] = highlight_php_code($php_string . $php_parts[$php_i]); |
| 1305 |
|
} |
| 1306 |
|
|
| 1307 |
|
// Fix the PHP code stuff... |
| 1308 |
|
$data[0] = str_replace("<pre style=\"display: inline;\">\t</pre>", "\t", implode('', $php_parts)); |