{"id":27647,"date":"2020-02-05T14:31:01","date_gmt":"2020-02-05T06:31:01","guid":{"rendered":"http:\/\/4563.org\/?p=27647"},"modified":"2020-02-05T14:31:01","modified_gmt":"2020-02-05T06:31:01","slug":"%e6%b1%82%e4%b8%aaphp-preg_replace%e6%ad%a3%e5%88%99%e6%9b%bf%e6%8d%a2%ef%bc%8c%e8%b0%a2%e8%b0%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=27647","title":{"rendered":"\u6c42\u4e2aphp preg_replace\u6b63\u5219\u66ff\u6362\uff0c\u8c22\u8c22"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>jekyll<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 22:33:43\t<\/p>\n<h3>\u6c42\u4e2aphp preg_replace\u6b63\u5219\u66ff\u6362\uff0c\u8c22\u8c22<\/h3>\n<p>  \t\t\u9700\u8981\u628a<br \/>  201912\/29\/220156zrw2g8c4c5380288.jpg<br \/>  \u901a\u8fc7php preg_replace\u6b63\u5219\u66ff\u6362\u4e3a<br \/>  201912\/29\/220156zrw2g8c4c5380288.jpg.thumb.jpg<\/p>\n<p>  \u540c\u65f6\u652f\u6301\u628a<br \/>  201912\/29\/220156zrw2g8c4c5380289.png<br \/>  \u66ff\u6362\u4e3a<br \/>  201912\/29\/220156zrw2g8c4c5380289.png.thumb.png<\/p>\n<p>  php\u5927\u4f6c\u5e2e\u5e2e\u5fd9~\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>Kasumi<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 22:37:17\t<\/p>\n<p>  \t\t\t\t\t<strong>jekyll<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 22:57:25\t<\/p>\n<h3><\/h3>\n<p>  \t\tKasumi \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 22:37<br \/>  \u8fd9\u4e0d\u662f\u76f4\u63a5\u5728\u540e\u9762\u52a0\u4e86\u4e2a.thumb.jpg\u5417\uff1f<\/p>\n<p> \u9700\u8981\u6b63\u5219\u5339\u914d\u4e0d\u540c\u7c7b\u578b\u7684\u6587\u4ef6\u540e\u7f00~\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>huahua101<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:09:18\t<\/p>\n<h3><\/h3>\n<p>  \t\t&lt;?php<br \/>  $file = &quot;201912\/29\/220156zrw2g8c4c5380288.jpg&quot;;<br \/>  $file = preg_replace(&#8216;\/([wW]*?).jpg\/&#8217;,&#8217;$1&#8242;.&#8217;.jpg.thumb.jpg&#8217;,$file);<br \/>  echo $file;<br \/>  ?&gt;<\/p>\n<p>  \u4f60\u8bd5\u8bd5\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>jekyll<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:13:21\t<\/p>\n<h3><\/h3>\n<p>  \t\thuahua101 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:09<br \/>  \u4f60\u8bd5\u8bd5<\/p>\n<p> \u5927\u4f6c\uff0c\u600e\u4e48\u628a\u8fd9\u4e2a\u540e\u7f00\u4e5f\u5339\u914d\u4e0a\uff0c\u5b9e\u73b0png,gif\u4e4b\u7c7b\u7684\u4e5f\u9002\u7528\u5462\uff1f\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>huahua101<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:18:08\t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 huahua101 \u4e8e 2019-12-30 23:19 \u7f16\u8f91 <\/p>\n<p> jekyll \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:13<br \/>  \u5927\u4f6c\uff0c\u600e\u4e48\u628a\u8fd9\u4e2a\u540e\u7f00\u4e5f\u5339\u914d\u4e0a\uff0c\u5b9e\u73b0png,gif\u4e4b\u7c7b\u7684\u4e5f\u9002\u7528\u5462\uff1f<\/p>\n<p>  \u7b28\u529e\u6cd5\uff0c\u7ee7\u7eed\u590d\u5236\uff0c\u76f8\u5f53\u4e8e\u7ee7\u7eed\u518d\u641c\u7d22\u5176\u5b83\u540e\u7f00\u5728\u66ff\u6362<\/p>\n<p>  $file = &quot;201912\/29\/220156zrw2g8c4c5380288.jpg&quot;;<br \/>  $file = preg_replace(&#8216;\/([wW]*?).jpg\/&#8217;,&#8217;$1&#8242;.&#8217;.jpg.thumb.jpg&#8217;,$file);<br \/>  $file = preg_replace(&#8216;\/([wW]*?).png\/&#8217;,&#8217;$1&#8242;.&#8217;.png.thumb.png&#8217;,$file);<br \/>  $file = preg_replace(&#8216;\/([wW]*?).gif\/&#8217;,&#8217;$1&#8242;.&#8217;.gif.thumb.gif&#8217;,$file);<br \/>  echo $file;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>huahua101<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:24:23\t<\/p>\n<h3><\/h3>\n<p>  \t\thuahua101 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:18<br \/>  \u7b28\u529e\u6cd5\uff0c\u7ee7\u7eed\u590d\u5236\uff0c\u76f8\u5f53\u4e8e\u7ee7\u7eed\u518d\u641c\u7d22\u5176\u5b83\u540e\u7f00\u5728\u66ff\u6362<\/p>\n<p> \u6216\u8005\u8bd5\u8bd5\u8fd9\u4e2a<\/p>\n<p>  &lt;?php<br \/>  $file = &quot;201912\/29\/220156zrw2g8c4c5380288.jpg&quot;.&quot;&lt;br&gt;201912\/29\/220156zrw2g8c4c5380288.png&quot;.&quot;&lt;br&gt;201912\/29\/220156zrw2g8c4c5380288.gif&quot;;<br \/>  $filex = $file;<br \/>  $file = preg_replace(&#8216;\/(.*?).jpg\/&#8217;,&#8217;$1&#8242;.&#8217;.jpg.thumb.jpg&#8217;,$file);<br \/>  $file = preg_replace(&#8216;\/(.*?).png\/&#8217;,&#8217;$1&#8242;.&#8217;.png.thumb.png&#8217;,$file);<br \/>  $file = preg_replace(&#8216;\/(.*?).gif\/&#8217;,&#8217;$1&#8242;.&#8217;.gif.thumb.gif&#8217;,$file);<br \/>  echo $filex;<br \/>  echo &quot;&lt;hr&gt;&quot;;<br \/>  echo $file;<br \/>  ?&gt;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>jekyll<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:27:04\t<\/p>\n<h3><\/h3>\n<p>  \t\thuahua101 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:18<br \/>  \u7b28\u529e\u6cd5\uff0c\u7ee7\u7eed\u590d\u5236\uff0c\u76f8\u5f53\u4e8e\u7ee7\u7eed\u518d\u641c\u7d22\u5176\u5b83\u540e\u7f00\u5728\u66ff\u6362<\/p>\n<p> \u611f\u8c22\uff01\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u84dd\u8272\u5e7d\u5f71<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:27:40\t<\/p>\n<h3><\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 \u84dd\u8272\u5e7d\u5f71 \u4e8e 2019-12-30 23:43 \u7f16\u8f91 <\/p>\n<p> &lt;?php <br \/>  $data = &quot;201912\/29\/220156zrw2g8c4c5380288.jpg&quot;;<br \/>  echo preg_replace(&#8216;\/(.w*)$\/&#8217;, &#8216;$1.thumb$1&#8217;, $data);<br \/>  ?&gt;\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>zephyr<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : 2019-12-30 23:33:00\t<\/p>\n<h3><\/h3>\n<p>  \t\t$str=&quot;201912\/29\/220156zrw2g8c4c5380288.jpg&quot;;<br \/>  $ok=preg_replace (&quot;\/(.[wW]*)\/&quot;,&quot;$1.thumb$1&quot;,$str);<br \/>  print_r($ok);<\/p>\n<p>  \u901a\u7528\u540e\u7f00\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>jekyll \u5927\u4f6c\u6709\u8bdd\u8bf4 : 20&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/27647"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27647"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/27647\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27647"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}