PHP code example of hypejunction / http-parser

1. Go to this page and download the library: Download hypejunction/http-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/ */

    

hypejunction / http-parser example snippets


// sample index.php
zleHttp\Client([
	'headers' => [
		'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12',
	],
	'allow_redirects' => [
		'max' => 3,
		'strict' => true,
		'referer' => true,
		'protocols' => ['http', 'https']
	],
	'timeout' => 5,
	'connect_timeout' => 5,
	'verify' => false,
]);
$parser = new \hypeJunction\Parser($client);

$url = $_GET['url'];

header('Content-Type: application/json');

echo json_encode($parser->parse($url));