Support the ongoing development of Laravel.io →
posted 10 years ago
Input
Last updated 2 years ago.
0

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.
0

Thanks. It was what i nedeed.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

closca closca Joined 9 Feb 2014

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.