$_POST['phone'], "email" => $_POST['email'], "name" => $_POST['name'], "lastname" => $_POST['lastname'], "button" => $_POST['Button'], "radio1" => $_POST['radio1'], "textarea" => $_POST['textarea'], "select" => $_POST['select'], "one" => $_POST['one'], "two" => $_POST['two'], "radio2" => $_POST['radio2'], "select2" => $_POST['select2'] ]; $jsonData = json_encode($formData); $file = "form.json"; file_put_contents($file, $jsonData);