PHP: Extract value from JSON array

前端 未结 2 1174
失恋的感觉
失恋的感觉 2021-01-28 15:01

I have an API that takes parameters from a post through JSON and I want to extract one of the values in an array for a key value pair. However, despite many attempts, I can\'t

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-28 15:36

    From your code above $json is a string and not a json object, your should use $request to access numberofhits

    $request['numberofhits']
    

提交回复
热议问题