PHP code example of pifeifei / html-parser
1. Go to this page and download the library: Download pifeifei/html-parser library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pifeifei / html-parser example snippets
use Pifeifei\HtmlParser;
$htmlParser = new HtmlParser();
$url = 'http://baijiahao.baidu.com/s?id=1644885607674637957';
$htmlParser->get($url);
dump($this->htmlParser->getTitle());
dump($this->htmlParser->getContent());