Get the inner text using curl concept in php

前端 未结 5 1647
情深已故
情深已故 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 15:52

    You can use strip_tags() for that

    echo trim(strip_tags($e->innertext));
    

    Or try to use preg_replace() to remove unwanted tag and its content

    echo preg_replace('/]*>([\s\S]*?)<\/span[^>]*>/', '', $e->innertext);
    

提交回复
热议问题