开发者

how to get array from unrealized data

my code-

$order[$j][1]=$q16;
<input typ开发者_如何学Ce="hidden" name="hdnOrder" value="<?php echo htmlentities(serialize($order)); ?>">

on my next page-

$order =  array_map('mysql_real_escape_string', unserialize($_REQUEST['hdnOrder']));

it gives me the following error- Warning: array_map() [function.array-map]: Argument #2 should be an array

I want order value in array form because of-

foreach($order as $row)


Your problem is the htmlentities() you are doing on the data.

Use htmlspecialchars(serialize($order), ENT_QUOTES) instead and do a htmlspecialchars_decode() afterwards.

$order =  array_map('mysql_real_escape_string', 
 unserialize(htmlspecialchars_decode($_REQUEST['hdnOrder'], ENT_QUOTES)));


You should use urldecode/urlencode instead of htmlentities.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜