We now have some PHP code that calls the relevant interface to return the JSON data. Now I want to implement PHP in HTML and output the returned data to HTML. Do you think this is realistic? (Note that the PHP section simply returns the JSON data, rather than writing something like document.write)
For example, the PHP interface will return a JSON data, I want the HTML to display a table to display the content.
I'm a client developer, and I know a little bit about the fur of the front. This is done because the original browser to open the server to do some of the pages, but a few pages of the performance is particularly bad and no one can tune (said to use a very advanced framework), so I now come up with the whole method.
Reply to discussion (solution)
The page to be executed must be the end of. PHP to parse PHP, and the logic to execute PHP should be wrapped up
After obtaining the JSON data, Json_decode ($json, True); An array that can be printed out to see
Embed the value of the array where you want it to appear, such as:
Get the data through Ajax and embed it in the page.
Use Ajax to call the PHP interface where you return the JSON data, and then use JS to parse the JSON to display on the page
Use Ajax to call the PHP interface where you return the JSON data, and then use JS to parse the JSON to display on the page
A simple example, see below.
' Fdipzone ', ' gender ' = ' male '), Array (' name ' = ' Tom ', ' gender ' = ' male '), Array (' name ' = ' Lucy '), ' Gender ' = ' female '); >
Thank you, you don't have to use this method at the end.
If you use the page, the special front-end developers to debug, I myself or from the client technology to find a way.