Answer the question
In order to leave comments, you need to log in
PHP. How to change the value of an array through a form on the site?
Good day. I searched the Internet for examples, but I could not find anything similar.
What I need?
Let's say there are two files, namely index.php and an array file, for example array.php.
The array.php file containing the $array array is connected to index.php.
array.php contains:
$array = [
'name' => 'Название',
'name2' => 'Название 2'
];
Answer the question
In order to leave comments, you need to log in
Since this is a difficult task for those who write answers on the Toaster, I will give the full code
include "array.php";
$array['определенное значение'] = значение из формы;
$out = var_export($array, true);
file_put_contents("array.php","<?php\n\$array = $out;");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question