Home >Backend Development >PHP Tutorial >mysql 口字符号怎么办
mysql 口字符号怎么处理?
mysql 口字符号怎么处理?
mysql 字段是text的,遇到 口字符号就会自动从这里断开,后面的内容无法入库。使用addslashes函数无效。
口字符号就是比口字细那种,不知道是乱码还是无法显示的字符。
------解决思路----------------------
$s = '44CQ6IuP55CzVEVBTeiDtuWOn+ibi+eZveWPjemmiPCfmYjwn5mI44CR5pys5p2l6YO96KaB552h5LqG44CC56qB54S25p2l5LqG6IO25Y6f6JuL55m955qE5Y+N6aaI8J+YgvCfmILlpKfljYrlpJznmoTvvIzkvaDov5norqnnvqTph4znmoTnlLfku6PnkIbku6zmgI7kuYjmtLvwn5iz5Y2B5LqU5aSp55qE5pWI5p6c77yM5bCx5piv6L+Z5LmI54mb6YC84pyM54Wn6L+Z5Liq6LaL5Yq/5LiL5Y6777yM5LiA5Liq55aX56iL5LiN5q2i5aSn5LiA5LiqY3Vw5LqG5ZCn8J+Ysei/meWwseaYr+iDtuWOn+ibi+eZveS4uuWVpei/meS5iOeBq+eahOaEv+aEj++8gfCfkYrwn5GK5LiA55aX56iL5peg5pWI6YCA5qy+77yB5bCx5piv5pyJ5bqV5rCU4pyMd2VpeGluOnN1bGluMDkwOA==';<br /><br />$s = base64_decode($s);<br />//echo $s, PHP_EOL;<br />preg_match_all('/./u', $s, $m);<br />//print_r($m[0]);<br />echo bin2hex($m[0][13]);<br />f09f9988
$text = preg_replace_callback('/[\xf0-\xf7].{3}/', function($r) { return [email protected]' . base64_encode($r[0]);}, $text);