How to solve the problem of asking a regular wording

Source: Internet
Author: User
Tags preg
The regular wording of asking for advice
$str = '



    • Inexplicable


      Fans: 932


      Venture capital person





    • Yat Sen <


      Fans: 993


      Financial





    • King


      Fans: 1093


      IT




';

How does this string match the url,imgurl,name,fans,job of each Li, such as the first
  • Should be matched separately out of Http://aaa.com/iclock,/images/j22.jpg, inexplicable, 932, venture capitalists.

    ------Solution--------------------
    PHP Code
    [User:root time:06:22:25 path:/home/liangdong/php]$ php preg.php Array ([0] = = Array ([0] = =
  • Inexplicable

    Fans: 932

    Venture capital person

  • [1] = = http://aaa.com/moming [2] =/images/j22.jpg [3] = [4] + = fan: 932 [5] = = Venture capital person) [1] = = Array ([0] = =
  • Yat Sen <

    Fans: 993

    Financial

  • [1] [+] = Http://aaa.com/yxian [2] =/images/j7.jpg [3] + Yat Sen < [4] = fan: 993 [5] = finance) [2] = = Array ([0] = =
  • King

    Fans: 1093

    IT

  • [1] = HTTP://AAA.COM/IKCO [2] =/images/j2.jpg [3] = Kings [4] + fans: 1093 [5] = = IT)) [User:root time:06:22:26 path:/home/liangdong/php]$ Cat preg.php
  • Inexplicable

    Fans: 932

    Venture capital person

  • Yat Sen <

    Fans: 993

    Financial

  • King

    Fans: 1093

    IT

  • EOF; $n = Preg_match_all ('/
  • .*

    . *.*.*<\/a>.*<\/p>.* (. *) <\/p>.* (. *) <\/p>.*

    (. *) <\/p>.*<\/li>/ius ', $str, $matches, Preg_set_order); if ($n) {print_r ($matches);}? >

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.