php 数组 传递
发布网友
发布时间:2024-09-30 15:06
我来回答
共3个回答
热心网友
时间:2024-09-30 15:40
serialize() 序列化,
你只能用js把数组序列化,再用php把数组反序列化,
或把数组放到多个变量中提交,
详情请参考php中文手册,
http://www.php.net/manual/zh/language.oop.serialization.php
http://www.gougou.com/search?search=php%E4%B8%AD%E6%96%87%E6%89%8B%E5%86%8C&id=1
http://www.gougou.com/search?search=MySQL%E5%8F%82%E8%80%83%E6%89%8B%E5%86%8C&restype=-1&id=10000001&ty=0
热心网友
时间:2024-09-30 15:41
<form method="POST" action="1.php">
<input type="hidden" name="post_data" value="<?php echo base64_encode(serialize($array));?>" />
</form>
1.php
print_r(base64_decode(unserialize($_POST['post_data'])));
热心网友
时间:2024-09-30 15:41
在HTML页面用数组提交
<form method="POST" action="1.php">
<?php
foreach($array as $k => $v)
{
?>
<input type="hidden" name="data[]" value="<?=$v?>" />
<?php
}
?>
</form>
1.php
$receice = $_POST['data'];