Y
Y
Yuriy2017-01-10 16:17:48
PHP
Yuriy, 2017-01-10 16:17:48

How to correctly organize the output from the json file to the page?

Hello.
a little silly question,
there is a file with an html structure (template), there is a json file with data (product information, name, prices, description, etc.), what is the best way to organize output from json into the page code?

I mean do something like:

$file = file_get_contents('./data.json');
$data = json_decode($file); 
...
foreach(){}
...


Or is there something smarter? better... don't use php at all, do everything in javascript

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question