1. Go to this page and download the library: Download p3k/xray 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/ */
p3k / xray example snippets
$xray = new p3k\XRay();
$parsed = $xray->parse('https://aaronparecki.com/2017/04/28/9/');
$xray = new p3k\XRay();
$jsonfeed = '{"version":"https://jsonfeed.org/version/1","title":"Manton Reece", ... ';
// Note that the JSON document must be passed in as a string in this case
$parsed = $xray->parse('https://manton.micro.blog/feed.json', $jsonfeed);
$xray = new p3k\XRay([
'timeout' => 30 // Time-out all requests which take longer than 30s
]);
$parsed = $xray->parse('https://aaronparecki.com/2017/04/28/9/', [
'timeout' => 40 // Override the default 30s timeout for this specific request
]);
$parsed = $xray->parse('https://aaronparecki.com/2017/04/28/9/', $html, [
'target' => 'http://example.com/'
]);