php-dom不解释php标记


php dom not interpreting php tags

我正试图用php-dom获取div内部的值,我确实用下面的代码获取了值,但我没有用它获取php标签。php-dom没有解释标签,我知道php-dom不应该解释标签,但有没有办法解释标签?

$selected_div = "wrapper";
$file = 'http://localhost/jugni/selected.php'; // $file contents  = <html><body><div id = "wrapper"><?php echo "hello world"; ?></div></body></html>
$file_get= file_get_contents($file);
$doc = new DomDocument("1.0", "utf-8");
$doc->loadHTML($file_get);
$element = $doc->getElementById($selected_div);
$existing_Data = $element->firstChild->nodeValue;
echo $existing_Data;
//echo $existing_Data gives me  - hello world - , but what I want is the php tags with it as well , eg < ? php echo "hello world "; ?>

使用$file_get= file_get_contents($file);时,php已经在服务器端执行,$file_get中只显示其输出。此时将不存在原始php。