Home > Backend Development > PHP Tutorial > 如何用正则提取href、title、和span中的时间值

如何用正则提取href、title、和span中的时间值

WBOY
Release: 2016-06-13 10:16:02
Original
1622 people have browsed it

怎么用正则提取href、title、和span中的时间值

  • 五大途径2011-09-21




    ------解决方案--------------------
    /
  • (.*?)(.*?)/


    ------解决方案--------------------
    preg_match('#
  • 五大途径(.*)#s',$str,$m);
    echo $m[1]; //href中的值
    echo $m[2]; //titile中的值
    echo $m[3]; //span中的值
    ------解决方案--------------------
    “/”需要转义。
    “"”也需要。
  • Related labels:
    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template