您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP 类的有关问题

2025/12/14 11:48:55发布20次查看
php 类的问题
调用源码
php code$obj_car = new class_car;$num_carid = $obj_car->fn_caradd($_post);
类源码
php codeclass class_car { function fn_caradd($arr_post) { print_r($arr_post); }}
这样可以正常输出数组
php codearray( [action_post] => caradd [str_postchk] => [str_carname] => 高尔夫 [num_carbrand] => 7 [num_carmodel] => 615 [str_caremiss] => 1.4t [str_cartrans] => mt)
类源码
php codeclass class_car { function fn_caradd($arr_post) { print_r($arr_post[str_carname]); }}
这样输出乱码,求解,文件本身编码都没问题
------解决方案--------------------
header发送编码。
加在程序开始就行了。
header('content-type:text/html; charset=utf-8');
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product