简体   繁体   中英

imploding multidimensional arrays containing arrays

i'm trying to implode an array using:

  $implode_keys = implode(',', array_values($arr)
   $implode_values = implode(',', array_keys($arr)

serialize the array (or array of arrays). That's what serialization is intended for. When you need it back as an array (or array of arrays)... just unserialize it.

For future generations... serialization flattens out a data structure, such as an array, so that it may be stored in a simplified fashion, such as in a database.

也许您可以尝试json_encode()将其保存到文本字段中,如果这是一些非常静态的数据,则仅在插入数据后才读取数据(如果您不使用Ordering,则使用$ var数组或类似的数组进行查找),或者如果是(将)很小的桌子。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM