[Solved] Random value json in php [duplicate]


try this

$curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'http://havanzee.tk/api/quote.json');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, false);
    $strc = json_decode(curl_exec($curl),true);
    curl_close($curl);
     $i = rand(0,count($strc['danh-ngon'])-1);
    echo $strc['danh-ngon'][$i]['content'];

4

solved Random value json in php [duplicate]