Get the inner text using curl concept in php

前端 未结 5 1520
情深已故
情深已故 2021-01-25 15:18

This is html text in the website, i want to grab

1,000 Places To See Before You Die

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-25 16:00

    Use plaintext instead.

    echo $e->plaintext;
    

    But still the year will be present which you can trim off using regexp.

    Example from the documentation here:

    $html = str_get_html("
    foo bar
    "); $e = $html->find("div", 0); echo $e->tag; // Returns: " div" echo $e->outertext; // Returns: "
    foo bar
    " echo $e->innertext; // Returns: " foo bar" echo $e->plaintext; // Returns: " foo bar"

提交回复
热议问题