php 转换表单内编码

<?php
header("Content-type: text/html; charset=utf-8"); 
//qing yi utf-8 bian ma guan kan ci dai ma;

$select = iconv('GB2312', 'UTF-8', $_POST['KS_xm']);
$name = iconv('GB2312', 'UTF-8', $_POST['KS_name']);
$nl = iconv('GB2312', 'UTF-8', $_POST['KS_nl']);
$tel = iconv('GB2312', 'UTF-8', $_POST['KS_tel']);
header('Location: https://www.baidu.com&p='.'1.人群:'.$select.'<br />'.'2.姓名:'.$name.'<br />'.'3.年龄:'.$nl.'<br />'.'4.电话:'.$tel);
?>
原文地址:https://www.cnblogs.com/linyusong/p/7418125.html