Home  >  Article  >  PHP Framework  >  How to use QueryList4 in ThinkPHP5

How to use QueryList4 in ThinkPHP5

藏色散人
藏色散人forward
2021-02-28 16:25:322391browse

The following tutorial column will introduce how to use QueryList4 in ThinkPHP5. I hope it will be helpful to friends in need! ThinkPHP5 using QueryList4 tutorial

Almost every day, people ask me how to use QueryList4 in TP5, so I wrote this tutorial. To be honest, I don't really want to write this tutorial because it really doesn't have any technical content.

Installation steps

Download TP5

    Go to ThinkPHP official website to download the latest ThinkPHP5 framework code: http://www.thinkphp.cn
Install QueryList

    Execute the composer command in the ThinkPHP5 code root directory to install QueryList:
  • composer require jaeger/querylist
Use QueryList

    The following Demonstrates the use of QueryList in the
  • Index
  • controller:
<?php
namespace app\index\controller;

use QL\QueryList;

class Index
{
    public function index()
    {
       //采集某页面所有的图片
       $data = QueryList::get(&#39;http://cms.querylist.cc/bizhi/453.html&#39;)->find('img')->attrs('src');
       //打印结果
       print_r($data->all());
    }
}

That’s it. Note

PHP >= 7.0

    QueryList4 cannot be installed and used in environments below PHP7!
  • QueryList4 cannot be installed and used in environments below PHP7!
  • QueryList4 cannot be installed and used in environments below PHP7!

If you still don’t know how to install it, you can go to the QueryList exchange group (123266961) to download the complete ThinkPHP5 integrated QueryList4 compressed package.

The above is the detailed content of How to use QueryList4 in ThinkPHP5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete