Generally when we use input to pass form data, we can use <input name= "xxx[" value= "1" ><input name= "xxx[]" value= "2", to get $_post[' xxx '] As an array object, the data correspondence relation is related to the order of input in the form.
If you want to use an array of the specified key value, you can use <input name= "Xxx[a" value= "1" ><input name= "xxx[b]" value= "2" > This form, the resulting data is $_post[' xxx ' [' A '],$_post[' xxx ' [' B '], which corresponds more accurately.
PS, in the name of input enter the key value is not to call single or double quotation marks, such as name= "xxx['b'", because the resulting key will be escaped to]\ ' A\ ', the general use is also acceptable, But how to get the form data in and out of the file, like
$INDEXTDK = I ("POST.INDEXTDK");
$OTHERTDK = I ("POST.OTHERTDK");
File_put_contents ($this->uconfig_path. ' tdk.php ', ' <?php '. Php_eol. "Return". Var_export (' index ' = $INDEXTDK, ' other ' = $OTHERTDK],true). ‘;‘);
In these forms, the saved data is not very good and becomes
<?php
Return Array (
' Index ' =
Array (
' \ ' title\ ' ' = ' 111 ',
' \ ' desc\ ' ' = ' 2222 ',
' \ ' key\ ' ' = ' 3333 ',
),
' Other ' =
Array (
' \ ' title\ ' ' = ' 1166 ',
' \ ' desc\ ' ' = ' 2266 ',
' \ ' key\ ' ' = ' 3466 ',
),
);
Record the warning
Application of input Array in PHP