0
我试图做到这一点:PHP将函数的输出保存在变量中?
$productlist= $tpl->draw('products');
后来我想呼应它的其他一些文件:
而$ tpl->画(“产品”)中显示的一些输出例如
<div id="productlist>
include("products");
</div>
我试图做到这一点:PHP将函数的输出保存在变量中?
$productlist= $tpl->draw('products');
后来我想呼应它的其他一些文件:
而$ tpl->画(“产品”)中显示的一些输出例如
<div id="productlist>
include("products");
</div>
您可以使用会话变量将数据公开到另一个脚本中,或者从数据库或平面文件中存储和检索数据。
试试这个
$productlist= $tpl->draw('products');
//类文件
class drawing{
function draw($type) {
$str='';
if($type=='')
$type='default'
$ids=$type.'list';
$str="<div id='$ids'> include('$type') </div>";
return $str;
}
}
究竟什么是你的问题? – dpk2442
$ tryt ='