你好我试图在php中显示javascript内容,但我只得到javascript原始代码我需要得到实际的javascript内容,例如在html中,当我把:
<script type="text/javascript" src="https://www.cpagrip.com/script_include.php?id=25002&tracking_id="></script>
然后是它的正常但当我试图在这样的特定地方显示内容时:
<?php
$content = file_get_contents('https://www.cpagrip.com/script_include.php?id=25002&tracking_id=');
echo $content;
?>
它显示了原始代码
答案 0 :(得分:2)
添加<script>
代码:
<?php
$content = file_get_contents('https://www.cpagrip.com/script_include.php?id=25002&tracking_id=');
echo '<script type="text/javascript">' . $content . '</script>';
?>