调用源码
- PHP code
$obj_car = new class_car; $num_carId = $obj_car->fn_carAdd($_POST);
类源码
- PHP code
class class_car {
function fn_carAdd($arr_post) {
print_r($arr_post);
}
}
这样可以正常输出数组
- PHP code
Array
(
[action_post] => carAdd
[str_postChk] =>
[str_carName] => 高尔夫
[num_carBrand] => 7
[num_carModel] => 615
[str_carEmiss] => 1.4T
[str_carTrans] => MT
)
类源码
- PHP code
class class_car {
function fn_carAdd($arr_post) {
print_r($arr_post["str_carName"]);
}
}
这样输出乱码,求解,文件本身编码都没问题
------解决方案--------------------
header发送编码。
加在程序开始就行了。
header('Content-Type:text/html; charset=utf-8');