php包括打印1 [英] php include prints 1

查看:80
本文介绍了php包括打印1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写以下代码

<?php 
if ($id = mysql_real_escape_string(@$_GET['pid']) 
    && $uid = mysql_real_escape_string(@$_GET['file']))
       echo include "foo.php"; 
    else 
       echo include "bar.php"; 
?>

当我将include函数与旨在输出到页面的函数结合使用时(例如,或echo include'foo.php'),它将返回include,但在已包含的内容之后带有"1"包括在内.

When I use the include function in conjunction with a function that's designed to output to the page (e.g., or echo include 'foo.php'), it returns the include but with a "1" after the content that has been included.

推荐答案

echo include "foo.php"

应该是

include 'foo.php';

这篇关于php包括打印1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆