Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function select_all($path)
- {
- $file = file_get_contents($path.".json");
- $dec = json_decode($file);
- return($dec);
- }
- select_all("users");
- function new_tab($path, $new_content)
- {
- $old = select_all($path) ;
- array_push($old, $new_content);
- $new = json_encode($old);
- file_put_contents($path.".json", $new);
- var_dump($old);
- }
- new_tab("users", "hello");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement