首頁 > 後端開發 > php教程 > PHP 类的有关问题

PHP 类的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
發布: 2016-06-13 10:24:56
原創
914 人瀏覽過

PHP 类的问题
调用源码

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$obj_car = new class_car;$num_carId = $obj_car->fn_carAdd($_POST);
登入後複製



类源码
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->class class_car {    function fn_carAdd($arr_post) {        print_r($arr_post);    }}
登入後複製


这样可以正常输出数组
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->Array(    [action_post] => carAdd    [str_postChk] =>     [str_carName] => 高尔夫    [num_carBrand] => 7    [num_carModel] => 615    [str_carEmiss] => 1.4T    [str_carTrans] => MT)
登入後複製



类源码
PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->class class_car {    function fn_carAdd($arr_post) {        print_r($arr_post["str_carName"]);    }}
登入後複製


这样输出乱码,求解,文件本身编码都没问题

------解决方案--------------------
header发送编码。
加在程序开始就行了。

header('Content-Type:text/html; charset=utf-8');
相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
javascript - express post問題
來自於 1970-01-01 08:00:00
0
0
0
javascript - axios post請求404
來自於 1970-01-01 08:00:00
0
0
0
python - requests post問題
來自於 1970-01-01 08:00:00
0
0
0
javascript - 向nodejs發送post請求,只有options
來自於 1970-01-01 08:00:00
0
0
0
可不可以帳號用get,密碼用post
來自於 1970-01-01 08:00:00
0
0
0
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板