PHP 取数据遇到表格

来源:百度知道 编辑:UC知道 时间:2024/05/23 16:31:44
我做一个循环,当取出content时出现了问题因为里面有一些用的是表格.
能不能做一个判断当是表格时显示.........呢?

$sm="<A onclick=\"javascript:window.open('$sysurl/index.php?op=qiye&file=cart&action=add&aid=$cid&bid=$tid','','width=450,height=350,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');\" href=\"javascript:;\"><img src=$imgurl/qiye/goumai2.gif border=0 ></a>";
$tpl->newBlock("list_col");
$tpl->assign("cid",$cid);
$tpl->assign("picture2",$picture2);
$tpl->assign("picname",$picname);
$tpl->assign("sm",$sm);
$tpl->assign("dan",$danjia);
$tpl->assign("picture",$picture);
$tpl->assign("content",$a->msubstr($content,0,9));
$tpl->assign("name",$a->msubstr($name,0,6));
$tpl->assign("stime",date("Y-m-d"

不知道你是不是这个意思,你希望取出content字段中,含有表格标签的的字段。
如果是这样的话,
strstr($str2,$str1);
//从$str2中返回从$str1第一个字母开始到$str2结束的字串,有则返回该字串,无则返回false
或者正则ereg("<table\>",$str),包含table标签才读出

不明白你的意思。