为什么不给出正确的退出代码?
我的完整代码:
<?php
$numA_m = "2";
$res = '["110","2","1"]';
$numA_s = json_decode($res);
if ($numA_m == 1) {
$A_num_s = array("1", "2", "3", "4","110");
$A_nam_s = array("egh", "guide", "irl", "tic", "all");
}
if ($numA_m == 2) {
$A_num_s = array("1", "2","110");
$A_nam_s = array("sub", "forg","all");
}
$Rsp = str_replace($A_num_s, $A_nam_s, $numA_s);
$Rsp_In = str_replace($A_nam_s, $A_num_s, $Rsp);
echo '<pre>';
print_r($Rsp);
echo '<p>';
echo '<pre>';
print_r($Rsp_In);
?>
输出应该是:
数组(
[0] => all
[1] => forg
[2] => sub
)数组(
[0] => 110
[1] => 2
[2] => 1
)
但它是这样的:
数组
(
[0] => subsub0
[1] = > forg
[2] => sub
)
数组
(
[0] => 110
[1] => 2
[2] => 1
)
我该怎么办?
演示: http: //phpfiddle.org/main/code/srj-k3d