• 19-08-2021, 20:25:40
    #1
    Merhaba arkadaşlar aşağıdaki kodu curl ile array olarak nasıl görüntüleyebilirim php ile?

    <script id="__NEXT_DATA__" type="application/json">
    {
       "props":{
          "pageProps":{}
       },
       "page":"/",
       "query":{},
       "buildId":"mgml30LY3PGj-2IRzRxCf",
       "runtimeConfig":{},
       "nextExport":true,
       "autoExport":true,
       "isFallback":false
    }
    </script>
  • 19-08-2021, 21:13:56
    #2
    Üyeliği durduruldu
    xpath //script[@id="__NEXT_DATA__ "]
  • 20-08-2021, 21:54:20
    #3
    geceyarisi adlı üyeden alıntı: mesajı görüntüle
    xpath //script[@id="__NEXT_DATA__ "]
    Çalıştıramadim
  • 21-08-2021, 18:16:23
    #4
            $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:10
    #5
    dev
    Kurumsal Üye
    Djstation adlı üyeden alıntı: mesajı görüntüle
    Merhaba arkadaşlar aşağıdaki kodu curl ile array olarak nasıl görüntüleyebilirim php ile?

    <script id="__NEXT_DATA__" type="application/json">
    {
       "props":{
          "pageProps":{}
       },
       "page":"/",
       "query":{},
       "buildId":"mgml30LY3PGj-2IRzRxCf",
       "runtimeConfig":{},
       "nextExport":true,
       "autoExport":true,
       "isFallback":false
    }
    </script>
    Bu tarz islemler icin dom parser paketlerini kullanabilirsiniz. https://github.com/paquettg/php-html-parser