您可以使用以下代码来获取 "hkg-edge-2.wecast.hk":

$json = '{
    "succeed": true,
    "adaptor": "sldp",
    "folder": "live02_nimble",
    "load_balance": {
        "host/name": "hkg-edge-2.wecast.hk",
        "ip": "123.138.137.128"
    }
}';

$data = json_decode($json, true);
$host = $data["load_balance"]["host/name"];
echo $host; // Output: hkg-edge-2.wecast.hk

这里使用了 json_decode 函数将 JSON 数据解码为 PHP 数组,然后通过数组索引获取 "hkg-edge-2.wecast.hk" 的值。

succeed true adaptor sldp folder live02_nimble load_balance hostname hkg-edge-2wecasthk ip 123138137128 PHP 怎么得到hkg-edge-2wecasthk

原文地址: https://www.cveoy.top/t/topic/iGxS 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录