K
K
KShoha2015-09-10 18:16:16
PHP
KShoha, 2015-09-10 18:16:16

How to implement articles.json so that the latest articles are added to this file?

How to implement articles.json so that the latest articles are added to this file?
How to make it output an array and the body of this array, when news is added to the database, automatically updated to the place: id name, etc.? Help who knows, thanks in advance !!! Array example :
"feed": [
{
"id": 1,
"name": "National Geographic Channel",
"image": " someaddress.com/feed/img/cosmos.jpg ",
"status": "\" Science is a beautiful and emotional human endeavor,\" says Brannon Braga, executive producer and director. \"And Cosmos is all about making science an experience.\"",
"
"timeStamp": "1403375851930",
"url": null
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2015-09-10
@Sanasol

file get contents
json decode
array[] = article
json encode
file put contents

K
KShoha, 2015-09-10
@KShoha

In php, I understood in some.json itself I did not understand how to implement it)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question