Выход из литерала <? php и <? в Сценарии PHP

Никто не упомянул выравнивание нагрузки... haproxy, и т.д. Оптимизирует, кэшируется и загружается, баланс должен пережить почти что-либо. Однако я не уверен, находится ли stackoverflow позади подсистемы балансировки нагрузки;)

8
задан nohat 23 September 2009 в 23:50
поделиться

3 ответа

This:

<?php echo "<?php"; ?>

Will output:

<?php
12
ответ дан 5 December 2019 в 12:10
поделиться

You could wrap the whole ini inside heredoc as follows

<?php 
echo <<< EOF
<?php echo "stuff inside php tag"; ?>
EOF;
?>

Which when output doesn't render in the page but appears on the page source
or you can use html encoding for the tags

&lt;?php echo 'this'; ?&gt;

I think the later will suit you better.
If that doesn't do the job you could use ASCII encoding which I don't know much about

2
ответ дан 5 December 2019 в 12:10
поделиться

A quick & simple solution would to search through the php.ini and replace all within comments with unique markers, after the file has been parsed, simply replace those unique markers back with the corresponding php tag.

0
ответ дан 5 December 2019 в 12:10
поделиться
Другие вопросы по тегам:

Похожие вопросы: