$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);