How to check equal of value arrays in JSON by PHP -
I want to see two arrays if the value of an array is equivalent to $ reaction: 1 and otherwise for the $ response: 0 Example Array:
{"data_comment": [{"name": "a"}, {"" "," "", "" "," "", "" {$ Data_comment == $ data_comment2} {$ response 2 ["success"] = "" "1"; // resonant JSON response echo json_encode ($ response2);} and {$ response2 ["success "] =" 0 "; $ response 2 [" message "] =" error "; // copy json response echo json_encode ($ response2)} Therefore, if any of the data_comment If the value is with data_comment2 value then the result will be incorrect [$ response2 ["success"] = "0";] ..
But with my code, the result always [$ response 2 ["success" ] = "1";], there is not a similar value between data_action and data_comment2.
Thanks for any advice
$ data_comment === $ data_comment2 if ($ data_comment == = $ Data_comment2) Try using {$ response2 ["success"] = "1"; // resonant JSON response echo json_encode ($ response2); } And {$ response2 ["success"] = "0"; $ Response 2 ["message"] = "error"; // resonant json response echo json_encode ($ response2)}
Comments
Post a Comment