![](/img/trans.png)
[英]Is there a way to view php code after the includes and before its parsed?
[英]View PHP code after includes
基本上,我需要在包含后查看文件的PHP代碼。 我想確切地看到PHP代碼運行的是什么。 例如...
<?php // a.php
$a = 10;
?>
<?php // b.php
include('a.php');
$b = 20;
?>
如果我試圖獲取b.php的代碼,它將顯示以下內容:
<?php
$a = 10;
$b = 20;
?>
那可能嗎? 如果是這樣,怎么樣?
// at the end of your script
<?php
$totalRunCode = '';
$scripts = get_included_files();
foreach($scripts as $script)
{
$totalRunCode .= file_get_contents($script);
}
// do whatever with totalRunCode
雖然我不知道你為什么要這樣做。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.