怎么叫通过模板呢?不大明白。
但如果要传递数组可采用以下方法:
$a[0]='1';
$a[1]='2';
$a[2]='3';
$string = implode("<plode>",$a);
***
一下是传递参数
***
b.php?string=$string;
****************************
在b.php进行还原
$a = explode("<plode>",$string);
但如果要传递数组可采用以下方法:
$a[0]='1';
$a[1]='2';
$a[2]='3';
$string = implode("<plode>",$a);
***
一下是传递参数
***
b.php?string=$string;
****************************
在b.php进行还原
$a = explode("<plode>",$string);
Template
Smarty:
<{section name=sec loop=$contentlist}>
<input type="hidden" name="test[]" value="contentlist[sec].value">
<{/section}
ACTION
$test=$request->getParameter("test");
$request->setAttribute('test',"test");
View
通过smarty模板从session取值,然后,转发到页面!
也就ok了!
".php?a = " . serialize($a);$a = unserialize($_GET['a']); // 返回数组