$data = array(1) { [0] => array(10) { ["account_id"] => string(1) "1" ["account_type"] => string(1) "1" ["account_phone"] => string(11) "18284573042" ["account_password"] => string(32) "33863f368f1195d4e14d357bcd4aac2b" ["account_salt"] => string(20) "acfhjzHIJVW2!#^)[+.;" ["account_alipay"] => string(1) "0" ["account_createtime"] => string(1) "0" ["account_cash"] => string(1) "0" ["account_name"] => string(9) "汪昌宁" ["account_isdelete"] => string(1) "0" }}
How to convert to a one-dimensional array
I got this data using the thinkphp Select () method.
In what way to convert him into a one-dimensional array
Or, when querying this data, do not use the Select () method to get a one-dimensional array with other TP methods?
Reply content:
$data = array(1) { [0] => array(10) { ["account_id"] => string(1) "1" ["account_type"] => string(1) "1" ["account_phone"] => string(11) "18284573042" ["account_password"] => string(32) "33863f368f1195d4e14d357bcd4aac2b" ["account_salt"] => string(20) "acfhjzHIJVW2!#^)[+.;" ["account_alipay"] => string(1) "0" ["account_createtime"] => string(1) "0" ["account_cash"] => string(1) "0" ["account_name"] => string(9) "汪昌宁" ["account_isdelete"] => string(1) "0" }}
How to convert to a one-dimensional array
I got this data using the thinkphp Select () method.
In what way to convert him into a one-dimensional array
Or, when querying this data, do not use the Select () method to get a one-dimensional array with other TP methods?
Take it straight.
$data[0]
Thinkphp method
->first();
But can you say what you want, like what you've got? Or do you just want the first piece of information?
Using the Find method in the model
You can use foreach to iterate through
Do not use the thinkphp Select, which is to take multiple records, PHP online execution
Select () instead of find ()