说,我在 PHP 中有以下代码:
included_file.php:
DEFINE("MSWFFN",serialize(array(
"mnu"=>array("n"=>"topmnu.swf","w"=>"980px","h"=>"80px","i"=>"mnu","p"=>"&subp=home")
)));
main_file.php:
require_once("included_file.php");
global $MSWFFN;
$MSWFFN=unserialize(MSWFFN);
$swf=array_slice($MSWFFN,0,1,false); //first swf from cfg
var_dump($MSWFFN);
var_dump($swf);
根据这个问题和php网站上所说的,它应该返回一个带有整数键的数组,但它没有。
关于为什么不将 ' mnu ' 键更改为0的任何想法?
输出:
array (size=1)
'mnu' =>
array (size=5)
'n' => string 'topmnu.swf' (length=10)
'w' => string '980px' (length=5)
'h' => string '80px' (length=4)
'i' => string 'mnu' (length=3)
'p' => string '&subp=home' (length=10)
array (size=1)
'mnu' =>
array (size=5)
'n' => string 'topmnu.swf' (length=10)
'w' => string '980px' (length=5)
'h' => string '80px' (length=4)
'i' => string 'mnu' (length=3)
'p' => string '&subp=home' (length=10)
哦,顺便说一句,我的 Apache 版本是Apache/2.2.23 (Win32) PHP/5.3.18 (VertrigoServ v2.29)