Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次の$stringようにcURLから取得しました:
$string
{"time":0.01,"total_rows":7,"rows":[{"id":968},{"id":969},{"id":970},{"id":971},{"id":972},{"id":973},{"id":974}]}
id最大値 (つまり 974) を持つを取得する方法を知りたいのですが、PHP でこれを行うにはどうすればよいですか?
id
$result = '{"time":0.01,"total_rows":7,"rows":[{"id":968},{"id":969},{"id":970},{"id":971},{"id":972},{"id":973},{"id":974}]}'; $json = json_decode($result,true); $max = max($json["rows"]); echo $max["id"]; // "974"