javascript - Using dynamic value in JSON -


I have a json file (myJson.json) in which I'm adding a dynamic value

 < Code> [["Menu": " 

Now I use this JSON in my Php file as I am doing:

$ r = "HOME"; $ Str_data = file_get_contents ("MyJson.json"); $ Data = json_decode ($ str_data, true); Var_dump ($ data [0] ['menu']);


Output: " & lt ;? php echo $ r ?? & gt; " What is a "home" output?

You can type [{{{"{{{" {{{"menu": "R ",}]

and JSON

  $ r =" HOME "; Var_dump ($$ data [0] ['menu']);  

You will find the home as the output


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -