{"id":1122,"date":"2010-11-26T12:36:00","date_gmt":"2010-11-26T04:36:00","guid":{"rendered":"\/?p=1122"},"modified":"2010-11-26T12:36:00","modified_gmt":"2010-11-26T12:36:00","slug":"1122","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/php\/1122.html","title":{"rendered":"PHP\u6b63\u5219\u5907\u5fd8\u5f55"},"content":{"rendered":"
\u6ce8\u610f\u8d2a\u5a6a\u6027<\/strong><\/p>\n \u5047\u8bbe\u4f60\u60f3\u7528\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u4e00\u4e2aHTML \u6807\u7b7e\u3002\u4f60\u77e5\u9053\u8f93\u5165\u5c06\u4f1a\u662f\u4e00\u4e2a\u6709\u6548\u7684HTML \u6587\u4ef6\uff0c\u56e0\u6b64\u6b63\u5219\u8868\u8fbe\u5f0f\u4e0d\u9700\u8981\u6392\u9664\u90a3\u4e9b\u65e0\u6548\u7684\u6807\u7b7e\u3002\u6240\u4ee5\u5982\u679c\u662f\u5728\u4e24\u4e2a\u5c16\u62ec\u53f7\u4e4b\u95f4\u7684\u5185\u5bb9\uff0c\u5c31\u5e94\u8be5\u662f\u4e00\u4e2aHTML \u6807\u7b7e\u3002<\/p>\n \u8bb8\u591a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u65b0\u624b\u4f1a\u9996\u5148\u60f3\u5230\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<< <.+> >>\uff0c\u4ed6\u4eec\u4f1a\u5f88\u60ca\u8bb6\u7684\u53d1\u73b0\uff0c\u5bf9\u4e8e\u6d4b\u8bd5\u5b57\u7b26\u4e32\uff0c\u201cThis is a <EM>first<\/EM> test\u201d\uff0c\u4f60\u53ef\u80fd\u671f\u671b\u4f1a\u8fd4\u56de<EM>\uff0c\u7136\u540e\u7ee7\u7eed\u8fdb\u884c\u5339\u914d\u7684\u65f6\u5019\uff0c\u8fd4\u56de<\/EM>\u3002<\/p>\n \u4f46\u4e8b\u5b9e\u662f\u4e0d\u4f1a\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\u5c06\u4f1a\u5339\u914d\u201c<EM>first<\/EM>\u201d\u3002\u5f88\u663e\u7136\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u7ed3\u679c\u3002\u539f\u56e0\u5728\u4e8e\u201c+\u201d\u662f\u8d2a\u5a6a\u7684\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u201c+\u201d\u4f1a\u5bfc\u81f4\u6b63\u5219\u8868\u8fbe\u5f0f\u5f15\u64ce\u8bd5\u56fe\u5c3d\u53ef\u80fd\u7684\u91cd\u590d\u524d\u5bfc\u5b57\u7b26\u3002\u53ea\u6709\u5f53\u8fd9\u79cd\u91cd\u590d\u4f1a\u5f15\u8d77\u6574\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u5931\u8d25\u7684\u60c5\u51b5\u4e0b\uff0c\u5f15\u64ce\u4f1a\u8fdb\u884c\u56de\u6eaf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5b83\u4f1a\u653e\u5f03\u6700\u540e\u4e00\u6b21\u7684\u201c\u91cd\u590d\u201d\uff0c\u7136\u540e\u5904\u7406\u6b63\u5219\u8868\u8fbe\u5f0f\u4f59\u4e0b\u7684\u90e8\u5206\u3002<\/p>\n \u548c\u201c+\u201d\u7c7b\u4f3c\uff0c\u201c?*\u201d\u7684\u91cd\u590d\u4e5f\u662f\u8d2a\u5a6a\u7684\u3002<\/p>\n<\/p>\n \u6df1\u5165\u6b63\u5219\u8868\u8fbe\u5f0f\u5f15\u64ce\u5185\u90e8<\/p>\n \u8ba9\u6211\u4eec\u6765\u770b\u770b\u6b63\u5219\u5f15\u64ce\u5982\u4f55\u5339\u914d\u524d\u9762\u7684\u4f8b\u5b50\u3002\u7b2c\u4e00\u4e2a\u8bb0\u53f7\u662f\u201c<\u201d\uff0c\u8fd9\u662f\u4e00\u4e2a\u6587\u5b57\u7b26\u53f7\u3002\u7b2c\u4e8c\u4e2a\u7b26\u53f7\u662f\u201c.\u201d\uff0c\u5339\u914d\u4e86\u5b57\u7b26\u201cE\u201d\uff0c\u7136\u540e\u201c+\u201d\u4e00\u76f4\u53ef\u4ee5\u5339\u914d\u5176\u4f59\u7684\u5b57\u7b26\uff0c\u76f4\u5230\u4e00\u884c\u7684\u7ed3\u675f\u3002\u7136\u540e\u5230\u4e86\u6362\u884c\u7b26\uff0c\u5339\u914d\u5931\u8d25(\u201c.\u201d\u4e0d\u5339\u914d\u6362\u884c\u7b26)\u3002\u4e8e\u662f\u5f15\u64ce\u5f00\u59cb\u5bf9\u4e0b\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u7b26\u53f7\u8fdb\u884c\u5339\u914d\u3002\u4e5f\u5373\u8bd5\u56fe\u5339\u914d\u201c>\u201d\u3002\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u201c<.+\u201d\u5df2\u7ecf\u5339\u914d\u4e86\u201c<EM>first<\/EM> test\u201d\u3002\u5f15\u64ce\u4f1a\u8bd5\u56fe\u5c06\u201c>\u201d\u4e0e\u6362\u884c\u7b26\u8fdb\u884c\u5339\u914d\uff0c\u7ed3\u679c\u5931\u8d25\u4e86\u3002\u4e8e\u662f\u5f15\u64ce\u8fdb\u884c\u56de\u6eaf\u3002\u7ed3\u679c\u662f\u73b0\u5728\u201c<.+\u201d\u5339\u914d\u201c<EM>first<\/EM> tes\u201d\u3002\u4e8e\u662f\u5f15\u64ce\u5c06\u201c>\u201d\u4e0e\u201ct\u201d\u8fdb\u884c\u5339\u914d\u3002\u663e\u7136\u8fd8\u662f\u4f1a\u5931\u8d25\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u7ee7\u7eed\uff0c\u76f4\u5230\u201c<.+\u201d\u5339\u914d\u201c<EM>first<\/EM\u201d\uff0c\u201c>\u201d\u4e0e\u201c>\u201d\u5339\u914d\u3002\u4e8e\u662f\u5f15\u64ce\u627e\u5230\u4e86\u4e00\u4e2a\u5339\u914d\u201c<EM>first<\/EM>\u201d\u3002\u8bb0\u4f4f\uff0c\u6b63\u5219\u5bfc\u5411\u7684\u5f15\u64ce\u662f\u201c\u6025\u5207\u7684\u201d\uff0c\u6240\u4ee5\u5b83\u4f1a\u6025\u7740\u62a5\u544a\u5b83\u627e\u5230\u7684\u7b2c\u4e00\u4e2a\u5339\u914d\u3002\u800c\u4e0d\u662f\u7ee7\u7eed\u56de\u6eaf\uff0c\u5373\u4f7f\u53ef\u80fd\u4f1a\u6709\u66f4\u597d\u7684\u5339\u914d\uff0c\u4f8b\u5982\u201c<EM>\u201d\u3002\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u7531\u4e8e\u201c+\u201d\u7684\u8d2a\u5a6a\u6027\uff0c\u4f7f\u5f97\u6b63\u5219\u8868\u8fbe\u5f0f\u5f15\u64ce\u8fd4\u56de\u4e86\u4e00\u4e2a\u6700\u5de6\u8fb9\u7684\u6700\u957f\u7684\u5339\u914d\u3002<\/p>\n<\/p>\n \u7528\u61d2\u60f0\u6027\u53d6\u4ee3\u8d2a\u5a6a\u6027<\/b><\/p>\n \u4e00\u4e2a\u7528\u4e8e\u4fee\u6b63\u4ee5\u4e0a\u95ee\u9898\u7684\u53ef\u80fd\u65b9\u6848\u662f\u7528\u201c+\u201d\u7684\u60f0\u6027\u4ee3\u66ff\u8d2a\u5a6a\u6027\u3002\u4f60\u53ef\u4ee5\u5728\u201c+\u201d\u540e\u9762\u7d27\u8ddf\u4e00\u4e2a\u95ee\u53f7\u201c?\u201d\u6765\u8fbe\u5230\u8fd9\u4e00\u70b9\u3002\u201c*\u201d\uff0c\u201c{}\u201d\u548c\u201c?\u201d\u8868\u793a\u7684\u91cd\u590d\u4e5f\u53ef\u4ee5\u7528\u8fd9\u4e2a\u65b9\u6848\u3002\u56e0\u6b64\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u201c<.+?>\u201d\u3002\u8ba9\u6211\u4eec\u518d\u6765\u770b\u770b\u6b63\u5219\u8868\u8fbe\u5f0f\u5f15\u64ce\u7684\u5904\u7406\u8fc7\u7a0b\u3002\u518d\u4e00\u6b21\uff0c\u6b63\u5219\u8868\u8fbe\u5f0f\u8bb0\u53f7\u201c<\u201d\u4f1a\u5339\u914d\u5b57\u7b26\u4e32\u7684\u7b2c\u4e00\u4e2a\u201c<\u201d\u3002\u4e0b\u4e00\u4e2a\u6b63\u5219\u8bb0\u53f7\u662f\u201c.\u201d\u3002\u8fd9\u6b21\u662f\u4e00\u4e2a\u61d2\u60f0\u7684\u201c+\u201d\u6765\u91cd\u590d\u4e0a\u4e00\u4e2a\u5b57\u7b26\u3002\u8fd9\u544a\u8bc9\u6b63\u5219\u5f15\u64ce\uff0c\u5c3d\u53ef\u80fd\u5c11\u7684\u91cd\u590d\u4e0a\u4e00\u4e2a\u5b57\u7b26\u3002\u56e0\u6b64\u5f15\u64ce\u5339\u914d\u201c.\u201d\u548c\u5b57\u7b26\u201cE\u201d\uff0c\u7136\u540e\u7528\u201c>\u201d\u5339\u914d\u201cM\u201d\uff0c\u7ed3\u679c\u5931\u8d25\u4e86\u3002\u5f15\u64ce\u4f1a\u8fdb\u884c\u56de\u6eaf\uff0c\u548c\u4e0a\u4e00\u4e2a\u4f8b\u5b50\u4e0d\u540c\uff0c\u56e0\u4e3a\u662f\u60f0\u6027\u91cd\u590d\uff0c\u6240\u4ee5\u5f15\u64ce\u662f\u6269\u5c55\u60f0\u6027\u91cd\u590d\u800c\u4e0d\u662f\u51cf\u5c11\uff0c\u4e8e\u662f\u201c<.+\u201d\u73b0\u5728\u88ab\u6269\u5c55\u4e3a\u201c<EM\u201d\u3002\u5f15\u64ce\u7ee7\u7eed\u5339\u914d\u4e0b\u4e00\u4e2a\u8bb0\u53f7\u201c>\u201d\u3002\u8fd9\u6b21\u5f97\u5230\u4e86\u4e00\u4e2a\u6210\u529f\u5339\u914d\u3002\u5f15\u64ce\u4e8e\u662f\u62a5\u544a\u201c<EM>\u201d\u662f\u4e00\u4e2a\u6210\u529f\u7684\u5339\u914d\u3002\u6574\u4e2a\u8fc7\u7a0b\u5927\u81f4\u5982\u6b64\u3002<\/p>\n<\/p>\n \u60f0\u6027\u6269\u5c55\u7684\u4e00\u4e2a\u66ff\u4ee3\u65b9\u6848<\/b><\/p>\n \u6211\u4eec\u8fd8\u6709\u4e00\u4e2a\u66f4\u597d\u7684\u66ff\u4ee3\u65b9\u6848\u3002\u53ef\u4ee5\u7528\u4e00\u4e2a\u8d2a\u5a6a\u91cd\u590d\u4e0e\u4e00\u4e2a\u53d6\u53cd\u5b57\u7b26\u96c6\uff1a\u201c<[^>]+>\u201d\u3002\u4e4b\u6240\u4ee5\u8bf4\u8fd9\u662f\u4e00\u4e2a\u66f4\u597d\u7684\u65b9\u6848\u5728\u4e8e\u4f7f\u7528\u60f0\u6027\u91cd\u590d\u65f6\uff0c\u5f15\u64ce\u4f1a\u5728\u627e\u5230\u4e00\u4e2a\u6210\u529f\u5339\u914d\u524d\u5bf9\u6bcf\u4e00\u4e2a\u5b57\u7b26\u8fdb\u884c\u56de\u6eaf\u3002\u800c\u4f7f\u7528\u53d6\u53cd\u5b57\u7b26\u96c6\u5219\u4e0d\u9700\u8981\u8fdb\u884c\u56de\u6eaf\u3002<\/p>\n \u6700\u540e\u8981\u8bb0\u4f4f\u7684\u662f\uff0c\u672c\u6559\u7a0b\u4ec5\u4ec5\u8c08\u5230\u7684\u662f\u6b63\u5219\u5bfc\u5411\u7684\u5f15\u64ce\u3002\u6587\u672c\u5bfc\u5411\u7684\u5f15\u64ce\u662f<\/p>\n \u4e0d\u56de\u6eaf\u7684\u3002\u4f46\u662f\u540c\u65f6\u4ed6\u4eec\u4e5f\u4e0d\u652f\u6301\u60f0\u6027\u91cd\u590d\u64cd\u4f5c\u3002<\/p>\n<\/p>\n \u53d6\u53cd\u5b57\u7b26\u96c6<\/b><\/p>\n <\/span>\u5728\u5de6\u65b9\u62ec\u53f7\u201c[\u201d\u540e\u9762\u7d27\u8ddf\u4e00\u4e2a\u5c16\u62ec\u53f7\u201c^\u201d\uff0c\u5c06\u4f1a\u5bf9\u5b57\u7b26\u96c6\u53d6\u53cd\u3002\u7ed3\u679c\u662f\u5b57\u7b26\u96c6\u5c06\u5339\u914d\u4efb\u4f55\u4e0d\u5728\u65b9\u62ec\u53f7\u4e2d\u7684\u5b57\u7b26\u3002\u4e0d\u50cf\u201c.\u201d\uff0c\u53d6\u53cd\u5b57\u7b26\u96c6\u662f\u53ef\u4ee5\u5339\u914d\u56de\u8f66\u6362\u884c\u7b26\u7684\u3002<\/p>\n <\/span>\u9700\u8981\u8bb0\u4f4f\u7684\u5f88\u91cd\u8981\u7684\u4e00\u70b9\u662f\uff0c\u53d6\u53cd\u5b57\u7b26\u96c6\u5fc5\u987b\u8981\u5339\u914d\u4e00\u4e2a\u5b57\u7b26\u3002<<q[^u]>>\u5e76\u4e0d\u610f\u5473\u7740\uff1a\u5339\u914d\u4e00\u4e2aq\uff0c\u540e\u9762\u6ca1\u6709u \u8ddf\u7740\u3002\u5b83\u610f\u5473\u7740\uff1a\u5339\u914d\u4e00\u4e2aq\uff0c\u540e\u9762\u8ddf\u7740\u4e00\u4e2a\u4e0d\u662fu \u7684\u5b57\u7b26\u3002\u6240\u4ee5\u5b83\u4e0d\u4f1a\u5339\u914d\u201cIraq\u201d\u4e2d\u7684q\uff0c\u800c\u4f1a\u5339\u914d\u201cIraq is a country\u201d\u4e2d\u7684q \u548c\u4e00\u4e2a\u7a7a\u683c\u7b26\u3002\u4e8b\u5b9e\u4e0a\uff0c\u7a7a\u683c\u7b26\u662f\u5339\u914d\u4e2d\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u4e3a\u5b83\u662f\u4e00\u4e2a\u201c\u4e0d\u662fu \u7684\u5b57\u7b26\u201d\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":" \u6ce8\u610f\u8d2a\u5a6a\u6027<\/strong><\/p>\n \u5047\u8bbe\u4f60\u60f3\u7528\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u4e00\u4e2aHTML \u6807\u7b7e\u3002\u4f60\u77e5\u9053\u8f93\u5165\u5c06\u4f1a\u662f\u4e00\u4e2a\u6709\u6548\u7684HTML \u6587\u4ef6\uff0c\u56e0\u6b64\u6b63\u5219\u8868\u8fbe\u5f0f\u4e0d\u9700\u8981\u6392\u9664\u90a3\u4e9b\u65e0\u6548\u7684\u6807\u7b7e\u3002\u6240\u4ee5\u5982\u679c\u662f\u5728\u4e24\u4e2a\u5c16\u62ec\u53f7\u4e4b\u95f4\u7684\u5185\u5bb9\uff0c\u5c31\u5e94\u8be5\u662f\u4e00\u4e2aHTML \u6807\u7b7e\u3002<\/p>\n \u8bb8\u591a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u65b0\u624b\u4f1a\u9996\u5148\u60f3\u5230\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<< <.+> >>\uff0c\u4ed6\u4eec\u4f1a\u5f88\u60ca\u8bb6\u7684\u53d1\u73b0\uff0c\u5bf9\u4e8e\u6d4b\u8bd5\u5b57\u7b26\u4e32\uff0c\u201cThis is a <EM>first<\/EM> test\u201d\uff0c\u4f60\u53ef\u80fd\u671f\u671b\u4f1a\u8fd4\u56de<EM>\uff0c\u7136\u540e\u7ee7\u7eed\u8fdb\u884c\u5339\u914d\u7684\u65f6\u5019\uff0c\u8fd4\u56de<\/EM>\u3002<\/p>\n <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1122"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1122"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1122\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}