3v4l.org

run code in 300+ PHP versions simultaneously
<?php $param = "pc官网-baidu"; $param1 = "PC%E5%AE%98%E7%BD%91%E2%80%94360"; // echo urldecode($param1)."\n"; // $res1 = mb_convert_encoding(urldecode($param1), 'utf-8','gb2312'); // $res2 = mb_convert_encoding(urldecode($param1), 'utf-8'); // echo mb_strlen($res1, "utf-8") ,"\n", mb_strlen($res2, "utf-8"); // echo $res1,"\n",$res2; $decodeParam = urldecode($param1); $res1 = mb_convert_encoding($decodeParam, 'utf-8', 'gbk'); $res2 = mb_convert_encoding($decodeParam, 'gbk'); echo iconv("gb2312","utf-8",$decodeParam); if(mb_strlen($res1, 'utf-8') < mb_strlen($res2, 'utf-8')) { echo $res1; } else { echo $res2; } echo "\n" , $res1, "\n", $res2;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: iconv(): Wrong encoding, conversion from "gb2312" to "utf-8" is not allowed in /in/FSW9V on line 13 PC瀹樼綉鈥?60 PC瀹樼綉鈥?60 PC�����360

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.33 ms | 401 KiB | 8 Q