Array submission in thinkphp

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.