Generation

generate functionTue, 03 Jan 2023

developed database with the ability to save text data with a description with input and output

function add($data, $desc) { $file = file_get_contents('file.json'); $file = json_decode($file, true); $file[] = ['data' => $data, 'desc' => $desc]; $file = json_encode($file); file_put_contents('file.json', $file); }

Questions about programming?Chat with your personal AI assistant