Home  >  Article  >  Backend Development  >  请教怎么php怎么返回变量+组装html给ajax

请教怎么php怎么返回变量+组装html给ajax

WBOY
WBOYOriginal
2016-06-13 12:30:27746browse

请问如何php如何返回变量+组装html给ajax

function html($select,$name){<br />
global $pagecon;<br />
$a='1';<br />
$b='2';<br />
$result='';<br />
$result.='<ul id="thumbs">';<br />
while($row=$select->fetch()){<br />
$result.='<li class="'.$name.'isotope-item">';<br />
$result.='<img src="ztImg/'.$row['riseimg'].'"width=235 height=300 alt=""//></div><ul>';<br />
$result.='<h3 class="title">'.$row['ztname'].'</h3>';<br />
$result.='<span class="category">'. $row['zttype'].'</span>';	<br />
$result.='<p class="intro">推荐日期:'.$row['zttime'].'</p></div></li>';<br />
	}<br />
$result.='</ul>';<br />
$result.='<center><h4>'.$pagecon.'</h4></center>';<br />
return $result,$a,$b;<br />
}

需要返回$a变量和$b变量以及一个组装好的$result的html给ajax  请问在不用json的情况下 如果封装给ajax

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn