T
T
thesirvlad2021-06-27 18:21:33
PHP
thesirvlad, 2021-06-27 18:21:33

How to parse certain lines in php?

I have this code:

function curlGetPage ($url, $referer = 'https://google.com/')
{
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36 ');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_REFERER, $referer);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $response = curl_exec($ch);
  curl_close($ch);

  return $response;
}


$parserpage = curlGetPage('https://api.csgorun.pro/current-state?montaznayaPena=null');
$html = str_get_html($parserpage);
echo "$parserpage";

As a matter of fact, by clicking on the link, I get a lot of lines of different information, but from all this I need to separately output only crashes, for example: "crash":1.71 , but since I'm a beginner, I don't know how to do it. Please help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question