{"id":299,"date":"2021-08-12T13:41:00","date_gmt":"2021-08-12T13:41:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=299"},"modified":"2021-08-12T13:41:00","modified_gmt":"2021-08-12T13:41:00","slug":"299","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/08\/12\/299\/","title":{"rendered":"\u767e\u5ea6\u641c\u7d22\u7ed3\u679curl\u52a0\u5bc6\u7b97\u6cd5 PHP\u6e90\u7801"},"content":{"rendered":"<h2>\u628aPython\u6e90\u7801\u6539\u6210\u4e86PHP\u7248\uff0c\u8fd8\u5728\u5b66PHP\uff0c\u56e0\u4e3a\u4e24\u79cd\u8bed\u8a00\u6709\u4e0d\u540c\uff0c\u8c03\u8bd5\u4e86\u8001\u534a\u5929\uff0c\u6316\u4e86\u51e0\u4e2a\u5751\uff0c\u586b\u4e86\u51e0\u4e2a\u5751<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.lyvba.com\/index.php\/archives\/298\/\">\u767e\u5ea6\u641c\u7d22\u7ed3\u679curl\u52a0\u5bc6\u7b97\u6cd5 Python\u6e90\u7801<\/a><\/li>\n<li><a href=\"https:\/\/www.lyvba.com\/index.php\/archives\/298\/\">https:\/\/www.lyvba.com\/index.php\/archives\/298\/<\/a><\/li>\n<\/ul>\n<h2>\u4f7f\u7528 \u547d\u4ee4\u884c\u89e3\u91ca\u811a\u672c<\/h2>\n<pre><code>$ php url.php\nwww.lyvba.com\/index.php\/archives\/299\/ --&gt; \\r\nhttps:\/\/www.baidu.com\/link?url=a3f48d30fc293c5e471ef23de092fddc99fdd688685fefb97e96dcc7fd825b7d3c4eabfd798bbe9d68b609937ce2c51147ad0004bc38c1<\/code><\/pre>\n<h2>PHP\u8bed\u8a00\u7684\u5168\u5c40\u53d8\u91cf\u8981\u5728\u51fd\u6570\u4e2d <code>global $x, $y, $ascii, $data;<\/code> \u5168\u5c40\u7533\u660e\u624d\u80fd\u4f7f\u7528<\/h2>\n<ul>\n<li>\n<p>\u91cd\u65b0\u6539\u4e86\u51fd\u6570\u7248\uff0c\u548c Python\u5c31\u66f4\u52a0\u8c61\u4e86<\/p>\n<pre><code>&lt;?php\n\/\/$ascii\u7801\u8868x,y\u4f4d\u7f6e\n$ascii = [\n  0 =&gt; [ ' ', '!', '\"', '#', '$', '%', '&amp;', \"'\", '(', ')', '*', '+', ',', '-', '.', '\/' ],\n  1 =&gt; [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '&lt;', '=', '&gt;', '?' ],\n  2 =&gt; [ '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L','M', 'N', 'O'  ],\n  3 =&gt; [ 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\',']', '^', '_' ],\n  4 =&gt; [ '\"', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o' ],\n  5 =&gt; [ 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', ' ' ]\n  ];\n\n\/\/url\u7b2cN\u4e2a\u4f4d\u7f6e\u5bf9\u5e94\u7684(x,y)\uff0c\u76ee\u524d\u53ea\u5f97\u523080\u4f4d\u7684url\n$data = [\n  [13, 10], [10, 1], [16, 15], [7, 6], [5, 13], [18, 9], [13, 11], [7, 12],\n  [10, 5], [15, 9], [15, 9], [13, 5], [16, 11], [0, 1], [8, 2], [8, 5],\n  [0, 0], [17, 15], [14, 8], [2, 1], [10, 5], [17, 14], [16, 5], [3, 8],\n  [14, 9], [5, 8], [15, 1], [3, 15], [13, 10], [10, 12], [5, 7], [0, 2],\n  [18, 14], [0, 15], [1, 6], [13, 5], [2, 1], [15, 14], [18, 8], [18, 9],\n  [1, 10], [14, 14], [13, 2], [5, 3], [5, 8], [0, 4], [1, 5], [16, 1],\n  [8, 1], [2, 5], [10, 7], [10, 15], [14, 14], [17, 3], [15, 0], [14, 5],\n  [7, 7], [3, 4], [14, 8], [12, 0], [13, 12], [12, 3], [6, 5], [3, 1],\n  [1, 14], [5, 4], [0, 12], [7, 0], [10, 7], [15, 12], [8, 2], [18, 15],\n  [3, 12], [1, 12], [0, 15], [17, 4], [17, 2], [11, 1], [3, 12], [11, 5],\n  [0, 13], [1, 1], [2, 12]\n  ];\n\n\/\/\u6240\u6709\u7684y\u503c\n$y = ['0123456789abcdef', '1032547698badcfe', '23016745ab89efcd', '32107654ba98fedc',\n    '45670123cdef89ab', '54761032dcfe98ba', '67452301efcdab89', '76543210fedcba98',\n    '89abcdef01234567', '98badcfe10325476', 'ab89efcd23016745', 'ba98fedc32107654',\n    'cdef89ab45670123', 'dcfe98ba54761032', 'efcdab8967452301', 'fedcba9876543210'];\n\n\/\/\u6240\u6709\u7684x\u503c\n$x = ['016745', '107654', '234567', '321076', '325476', '452301', '543210',\n    '670123', '765432', '761032', '89abcd', '89efcd', '98fedc', 'abcdef',\n    'badcfe', 'cdab89', 'dcba98', 'ef89ab', 'fe98ba' ];\n\n\/\/ \u6d4b\u8bd5\u6570\u7ec4   var_dump($ascii[3]);   print sizeof($data);   var_dump($x);\n\nfunction encode_url($url){\n  global $x, $y, $ascii, $data;\n  $mi = '';\n  for ($i = 0; $i != strlen($url); $i++){\n      $ch = $url[$i];  $f_real_x = -1;  $f_real_y = -1;\n\n      for ($real_x = 0; $real_x != sizeof($ascii); $real_x++){\n          $real_y_chs = $ascii[$real_x];\n\n          for($real_y = 0; $real_y != sizeof($real_y_chs); $real_y++){\n              $real_y_ch= $real_y_chs[$real_y];\n              if ($real_y_ch == $ch){\n                  $f_real_x = $real_x;\n                  $f_real_y = $real_y;\n              }\n          }\n      }\n      if (($f_real_y != -1) &amp;&amp; ($f_real_x != -1)) {\n          $this_data_x = $x[$data[$i][0]];\n          $encode_x = $this_data_x[$f_real_x];\n          $mi .= $encode_x;\n          $this_data_y = $y[$data[$i][1]];\n          $encode_y = $this_data_y[$f_real_y];\n          $mi .= $encode_y;\n      }\n  }\n  return  'https:\/\/www.baidu.com\/link?url=a3f48d30fc293c5e471ef23de092fddc99' . $mi;\n}\n\n$url =\"www.lyvba.com\/index.php\/archives\/299\/\";\n$t = encode_url($url);\nprint $url . \" --&gt; \" . $t;\n\n?&gt;<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u5f00\u59cb\u7b2c\u4e00\u7248\u7a0b\u5e8f \u56e0\u4e3a\u4e0d\u77e5\u9053\u51fd\u6570\u91cc\u4f7f\u7528\u5168\u5c40\u53d8\u91cf\uff0c\u6240\u4ee5\u5faa\u5e8f\u8c03\u8bd5\u8bed\u53e5<\/h3>\n<pre><code>$url =\"www.lyvba.com\/index.php\/archives\/298\/\";\n$mi = '';\nfor ($i = 0; $i != strlen($url); $i++){\n    $ch = $url[$i];  $f_real_x = -1;  $f_real_y = -1;\n\n    for ($real_x = 0; $real_x != sizeof($ascii); $real_x++){\n        $real_y_chs = $ascii[$real_x];\n\n        for($real_y = 0; $real_y != sizeof($real_y_chs); $real_y++){\n            $real_y_ch= $real_y_chs[$real_y];\n            if ($real_y_ch == $ch){\n                $f_real_x = $real_x;\n                $f_real_y = $real_y;\n            }\n        }\n    }\n    \/\/ \u5f00\u59cb\u5361\u5728\u4e86\u8fd9\u91cc  '.\u548c\/\u7b49\u6807\u70b9\u7b26\u53f7\u5c31\u4e22\u5931' \u6539\u6210\u4e86 -1 \u5224\u65ad \u7f51\u4e0a\u5176\u4ed6\u7248\u672c\uff0c\u4e0d\u5224\u65ad\u65e0\u6761\u4ef6\u6267\u884c\u4e0b\u9762\u7f16\u7801\u8bed\u53e5\u4e5f\u884c\n    if (($f_real_y != -1) &amp;&amp; ($f_real_x != -1)) {\n        $this_data_x = $x[$data[$i][0]];\n        $encode_x = $this_data_x[$f_real_x];\n        $mi .= $encode_x;\n        $this_data_y = $y[$data[$i][1]];\n        $encode_y = $this_data_y[$f_real_y];\n        $mi .= $encode_y;\n    }\n}\n\n$bdurl =  'https:\/\/www.baidu.com\/link?url=a3f48d30fc293c5e471ef23de092fddc99' . $mi;\necho $bdurl . \" &lt;--&gt; \" . \"www.lyvba.com\/index.php\/archives\/298\/\" ;\n<\/code><\/pre>\n<h2>\u7f51\u4e0a\u6709\u4eba\u8d21\u732e\u7248\u672c\uff0c\u540c\u6211 Python\u6539php\u65b9\u6cd5\u4e00\u6837\uff0c\u53ea\u662f\u7cbe\u7b80\u4e86\u8bed\u53e5<\/h2>\n<pre><code>function baidu($domain='www.abeip.com'){\n    global $x, $y, $ascii, $data;\n\n    $domains = str_split($domain);\n    $mi='';\n    for($i=0;$i&lt;count($domains);$i++){\n        $f_real_x ='';  $f_real_y ='';\n\n        for($real_x=0;$real_x&lt;count($ascii);$real_x++){\n            $real_y_chs=$ascii[$real_x];\n\n            for($real_y=0;$real_y&lt;count($real_y_chs);$real_y++){\n                if($real_y_chs[$real_y]==$domains[$i]){\n                    $f_real_x = $real_x ;\n                    $f_real_y = $real_y;\n    } } }\n    \/\/ \u8fd9\u91cc\u4e0d\u5224\u65ad $ascii\u7801\u8868x,y \u95ee\u9898\u5176\u5b9e\u4e5f\u4e0d\u5927\n    $this_data_x=$x[$data[$i][0]];\n    $encode_x = $this_data_x[$f_real_x];\n\n    $this_data_y = $y[$data[$i][1]];\n    $encode_y = $this_data_y[$f_real_y];\n\n    $mi = $mi. $encode_x. $encode_y;\n    return 'http:\/\/www.baidu.com\/link?url=a3f48d30fc293c5e471ef23de092fddc99' . $mi;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u628aPython\u6e90\u7801\u6539\u6210\u4e86PHP\u7248\uff0c\u8fd8\u5728\u5b66PHP\uff0c\u56e0\u4e3a\u4e24\u79cd\u8bed\u8a00\u6709\u4e0d\u540c\uff0c\u8c03\u8bd5\u4e86\u8001\u534a\u5929\uff0c\u6316\u4e86\u51e0\u4e2a\u5751\uff0c\u586b\u4e86\u51e0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[34],"class_list":["post-299","post","type-post","status-publish","format-standard","hentry","category-learn","tag-php"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=299"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/299\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}