<script id="__NEXT_DATA__" type="application/json">
{
"props":{
"pageProps":{}
},
"page":"/",
"query":{},
"buildId":"mgml30LY3PGj-2IRzRxCf",
"runtimeConfig":{},
"nextExport":true,
"autoExport":true,
"isFallback":false
}
</script> script id="__NEXT_DATA__" type İçerisinden Ver Alma
4
●93
- 19-08-2021, 20:25:40Merhaba arkadaşlar aşağıdaki kodu curl ile array olarak nasıl görüntüleyebilirim php ile?
- 21-08-2021, 18:16:23
$curlOutput = ' <script id="__NEXT_DATA__" type="application/json"> { "props":{ "pageProps":{} }, "page":"/", "query":{}, "buildId":"mgml30LY3PGj-2IRzRxCf", "runtimeConfig":{}, "nextExport":true, "autoExport":true, "isFallback":false } </script> '; $arr = []; preg_match('/<script id="__NEXT_DATA__" type="application\/json">(?<json>.*?)<\/script>/si', $curlOutput, $match); $json = isset($match["json"]) ? $match["json"] : null; if ($json) { $arr = json_decode($json, true); } print_r($arr); - 21-08-2021, 22:37:10Bu tarz islemler icin dom parser paketlerini kullanabilirsiniz. https://github.com/paquettg/php-html-parserDjstation adlı üyeden alıntı: mesajı görüntüle