The static page calls PHP to get the data and then format it to display that we already have some PHP code. you can call related interfaces to return JSON data. I want to adjust PHP in HTML and output the returned data to HTML. Is this a reality? (Note: The PHP part only returns JSON data, rather than writing documents. Write)
For example, if you call the PHP interface, a JSON data is returned. I want a table in HTML to display the data.
I am a client developer and have some knowledge about front-end. This is because the embedded browser is used to open several pages on the server, but the performance of several pages is particularly bad and nobody can tune them (it is said that a very advanced framework is used ), so now I have come up with the entire solution.
Reply to discussion (solution)
The executed page must end with. php to parse php. The php logic should be used for execution. Pack
After json data is obtained, json_decode ($ json, true) is an array, which can be printed for a moment.
Embed the value of the array into the display area, for example:
Get data through ajax and embed it into the page.
Use ajax to call the php interface for returning json data, and then parse json in js to display on the page
Use ajax to call the php interface for returning json data, and then parse json in js to display on the page
For a simple example, refer.
'Fdipregion', 'gender' => 'male'), array ('name' => 'Tom ', 'gender' => 'male '), array ('name' => 'Lucy ', 'gender' => 'female'),);?>
New Document