Support the ongoing development of →
posted 10 years ago
Last updated 2 years ago.

Not really, JSON is probably the easiest to modify because you can read the contents and decode it quickly with json_decode, then because it's an array the values can be changed easily and re-encoded with json_encode. So something like this.

$data = json_decode(file_get_contents('path/to/file.json'));

$data['key'] = 'new value';

file_put_contents('path/to/file.json', json_encode($data));
Last updated 2 years ago.

Thanks. It was what i nedeed.

Last updated 2 years ago.

Sign in to participate in this thread!


Your banner here too?

closca closca Joined 9 Feb 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.