How can I extract structured text from an HTML list in PHP?

后端 未结 3 480
名媛妹妹
名媛妹妹 2021-01-16 21:46

I have this string:

  • Page 1
  • Page 2
    • Sub Page A
3条回答
  •  走了就别回头了
    2021-01-16 22:35

    That's not "a string", it's HTML. You need to use an HTML parser like DOMDocument or simple_html_dom.

    See examples at http://htmlparsing.com/php.html

提交回复
热议问题