久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

取消設置多維數組中的列

Unset a column in a multidimensional array(取消設置多維數組中的列)
本文介紹了取消設置多維數組中的列的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有這個數組 $output 看起來像這樣:

I have this array $output which looks like this:

Array(
    [0] => Array(
        [0] => 1a
        [1] => 1b
        [2] => 1c
    )
    [1] => Array(
        [0] => 2a
        [1] => 2b
        [2] => 2c
    )
    [2] => Array(
        [0] => 3a
        [1] => 3b
        [2] => 3c
    )
    [3] => Array(
        [0] => 4a
        [1] => 4b
        [2] => 4c
    )
)

等等...

當我想刪除我只使用的第二個元素時:

When I want to remove the second element I just use:

$output = unset($output[1]);

獲得以下內容:

Array(
    [0] => Array(
        [0] => 1a
        [1] => 1b
        [2] => 1c
    )
    [1] => Array(
        [0] => 3a
        [1] => 3b
        [2] => 3c
    )
    [2] => Array(
        [0] => 4a
        [1] => 4b
        [2] => 4c
    )
)

我的問題是如何刪除數組中每個元素的第二個元素 ([0][1], [1][1], [2][1], [3][1] ,...) 得到以下內容:

My question is how to remove every second element of every element in the array ([0][1], [1][1], [2][1], [3][1] ,...) to get the following:

Array(
    [0] => Array(
        [0] => 1a
        [1] => 1c
    )
    [1] => Array(
        [0] => 2a
        [1] => 2c
    )
    [2] => Array(
        [0] => 3a
        [1] => 3c
    )
    [3] => Array(
        [0] => 4a
        [1] => 4c
    )
)

推薦答案

不能用簡單的命令完成,但可以使用循環:

Can't be done with a simple command, but you can use a loop:

foreach(array_keys($output) as $key) {
   unset($output[$key][1]);
}

這篇關于取消設置多維數組中的列的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 欧美日韩一区二区在线 | 天天做天天爱 | 91一区二区 | 成人免费毛片片v | www.久久爱 | 一区二区三区在线免费 | 久久在线 | 在线观看国产黄色 | 日韩黄色av | 在线观看的av | av一区在线 | 在线观看91 | 深夜视频在线观看 | 欧美成人极品 | 深夜福利在线播放 | 亚洲综合二区 | 精品视频999| 8x8ⅹ国产精品一区二区 | 久久久久久久久久国产精品 | 91一级片 | 一级做a爰片久久毛片潮喷 亚洲黄色天堂 | 日本视频免费观看 | 美女无遮挡网站 | www.久久久久久 | 亚洲欧美视频在线观看 | 国产激情视频在线 | 亚洲精品久久久久avwww潮水 | 色一情一乱一伦一区二区三区 | 亚洲免费精品 | 国产精品99久久久久久久久 | 国产三级精品三级在线观看 | 国产免费一区二区三区最新不卡 | 四虎精品视频 | 色婷婷中文字幕 | 国产三级在线免费观看 | 久久精品一区二区三区四区五区 | 国产h视频在线观看 | 成人av一区 | 国产精品剧情 | 国产区在线 | 97操碰|