Support the ongoing development of Laravel.io →
posted 8 years ago
Input
Last updated 7 months 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 7 months ago.
0

Thanks. It was what i nedeed.

Last updated 7 months ago.
0

Sign in to participate in this thread!

LaraJobs

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.

© 2022 Laravel.io - All rights reserved.