List of issues with the array submitted by forms in thinkphp
The output array submitted to the background is as follows:
How can I display the value of string (5) "Array "?
Reply to discussion (solution)
How did you print it?
Print_r ($ _ POST ['storder']);
This is from echo.
You directly print_r ($ _ POST) on the receiving page );
Let's see what the results are. Should you use var_dump () for output?
The form is correct.
Print_r ($ _ GET ['storder ']).
How did you print it? I printed print_r ($ _ POST) like this)
You directly print_r ($ _ POST) on the receiving page );
Let's see what the results are. Should you use var_dump () for output? I first printed print_r ($ _ POST) ['storder'] = array. then I want to check the data type before using var_dump to find it is string.
Do you not use the incoming data processing mechanism provided by thinkphp?
You did it yourself?
Post related code
Do you not use the incoming data processing mechanism provided by thinkphp?
You did it yourself?
Post related code
Thank you for your enthusiastic answers. I 've been searching for it for a long time. but why does trim filter fail to submit arrays?
// If (C ('Var _ FILTERS ') {$ filters = explode (', ', C ('Var _ FILTERS ')); foreach ($ filters as $ filter) {// global parameter filtering $ _ POST = array_map ($ filter, $ _ POST); $ _ GET = array_map ($ filter, $ _ GET) ;}$ filters is Array ([0] => trim)
If $ _ POST is a multi-dimensional array, problems may occur except one dimension.
This is better written.
Array_pai_recursive ($ _ POST, 'trim ');
Array_pai_recursive ($ _ GET, 'trim ');
Thank you for your support.