3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('Content-type: text/html; charset=utf-8'); echo '<br />百度关键词URL编码转换示例:<br />'; $urlBaidu = 'http://www.baidu.com/s?wd=%D6%D0%CE%C4'; $arrParse = parse_url($urlBaidu); var_dump($arrParse); parse_str($arrParse ['query'],$output); var_dump($output); echo '乱码:' . $output['wd'] . '<br />'; //将gb2312编码转换成utf-8编码 $strUTF8 = mb_convert_encoding($output['wd'], 'utf-8', 'gb2312'); echo '可读码:' . $strUTF8 . '<br />'; echo '<br />谷歌关键词URL编码转换示例:<br />'; $urlGoogle = 'http://www.google.cn/search?hl=zh-CN&source=hp&q=%E4%B8%AD%E6%96%87&aq=f&oq='; $arrParse = parse_url($urlGoogle); var_dump($arrParse); parse_str($arrParse ['query'],$output); var_dump($output); //谷歌关键词URL编码是utf-8,不用再作转换 echo '可读码:' . $output['q'] . '<br />'; echo $escaped = "This contains a \t tab character."; echo $unescaped = 'This just contains a slash and a t: \t';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aBO5I
function name:  (null)
number of ops:  60
compiled vars:  !0 = $urlBaidu, !1 = $arrParse, !2 = $output, !3 = $strUTF8, !4 = $urlGoogle, !5 = $escaped, !6 = $unescaped
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'Content-type%3A+text%2Fhtml%3B+charset%3Dutf-8'
          2        DO_ICALL                                                 
    5     3        ECHO                                                     '%3Cbr+%2F%3E%E7%99%BE%E5%BA%A6%E5%85%B3%E9%94%AE%E8%AF%8DURL%E7%BC%96%E7%A0%81%E8%BD%AC%E6%8D%A2%E7%A4%BA%E4%BE%8B%EF%BC%9A%3Cbr+%2F%3E'
    7     4        ASSIGN                                                   !0, 'http%3A%2F%2Fwww.baidu.com%2Fs%3Fwd%3D%25D6%25D0%25CE%25C4'
    9     5        INIT_FCALL                                               'parse_url'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !1, $9
   10     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   11    12        INIT_FCALL                                               'parse_str'
         13        FETCH_DIM_R                                      ~12     !1, 'query'
         14        SEND_VAL                                                 ~12
         15        SEND_REF                                                 !2
         16        DO_ICALL                                                 
   12    17        INIT_FCALL                                               'var_dump'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
   13    20        FETCH_DIM_R                                      ~15     !2, 'wd'
         21        CONCAT                                           ~16     '%E4%B9%B1%E7%A0%81%EF%BC%9A', ~15
         22        CONCAT                                           ~17     ~16, '%3Cbr+%2F%3E'
         23        ECHO                                                     ~17
   16    24        INIT_FCALL                                               'mb_convert_encoding'
         25        FETCH_DIM_R                                      ~18     !2, 'wd'
         26        SEND_VAL                                                 ~18
         27        SEND_VAL                                                 'utf-8'
         28        SEND_VAL                                                 'gb2312'
         29        DO_ICALL                                         $19     
         30        ASSIGN                                                   !3, $19
   18    31        CONCAT                                           ~21     '%E5%8F%AF%E8%AF%BB%E7%A0%81%EF%BC%9A', !3
         32        CONCAT                                           ~22     ~21, '%3Cbr+%2F%3E'
         33        ECHO                                                     ~22
   20    34        ECHO                                                     '%3Cbr+%2F%3E%E8%B0%B7%E6%AD%8C%E5%85%B3%E9%94%AE%E8%AF%8DURL%E7%BC%96%E7%A0%81%E8%BD%AC%E6%8D%A2%E7%A4%BA%E4%BE%8B%EF%BC%9A%3Cbr+%2F%3E'
   22    35        ASSIGN                                                   !4, 'http%3A%2F%2Fwww.google.cn%2Fsearch%3Fhl%3Dzh-CN%26source%3Dhp%26q%3D%25E4%25B8%25AD%25E6%2596%2587%26aq%3Df%26oq%3D'
   24    36        INIT_FCALL                                               'parse_url'
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $24     
         39        ASSIGN                                                   !1, $24
   25    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAR                                                 !1
         42        DO_ICALL                                                 
   26    43        INIT_FCALL                                               'parse_str'
         44        FETCH_DIM_R                                      ~27     !1, 'query'
         45        SEND_VAL                                                 ~27
         46        SEND_REF                                                 !2
         47        DO_ICALL                                                 
         48        INIT_FCALL                                               'var_dump'
         49        SEND_VAR                                                 !2
         50        DO_ICALL                                                 
   29    51        FETCH_DIM_R                                      ~30     !2, 'q'
         52        CONCAT                                           ~31     '%E5%8F%AF%E8%AF%BB%E7%A0%81%EF%BC%9A', ~30
         53        CONCAT                                           ~32     ~31, '%3Cbr+%2F%3E'
         54        ECHO                                                     ~32
   31    55        ASSIGN                                           ~33     !5, 'This+contains+a+%09+tab+character.'
         56        ECHO                                                     ~33
   32    57        ASSIGN                                           ~34     !6, 'This+just+contains+a+slash+and+a+t%3A+%5Ct'
         58        ECHO                                                     ~34
         59      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.34 ms | 1400 KiB | 23 Q