cunzhen
V2EX  ›  PHP

PHP 提取网页字符

  •  
  •   cunzhen · Nov 6, 2018 · 2594 views
    This topic created in 2772 days ago, the information mentioned may be changed or developed.
    PHP 新手,最近在练习正则表达式,但是感觉好难懂,虽然规则和语法都会。。。

    想获取 myip.ipip.net 网页的内容,把 IP,国家,省会,城市,运营商分别获取并分别存储,但是除了 IP 的正则表达式写对了(\d+\.\d+\.\d+\.\d+),其他的都不会弄了,有没有前辈写出详细代码并注释一下?
    2 replies    2018-11-19 16:36:34 +08:00
    cunzhen
        1
    cunzhen  
    OP
       Nov 7, 2018
    艾特一下各位~~~~~~~~~~~~~~~~~~~~~~~~~
    @Kaciras @zgx030030 @ThirdFlame @ifaii @wevsty @Arnie97 @avatar70t @hxsf @raysonx @mcfog @larsenlouis @sagaxu
    Joyboo
        2
    Joyboo  
       Nov 19, 2018
    匹配 ip 的正则没这么简单的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5926 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 02:10 · PVG 10:10 · LAX 19:10 · JFK 22:10
    ♥ Do have faith in what you're doing.