首頁 後端開發 php教程 php数组的有关问题

php数组的有关问题

Jun 13, 2016 am 10:20 AM
gt nbsp quot

php数组的问题
我也不知道是什么问题,
我有个数组(从数据库中取出来的)
Array
(
  [0] => 2
  [testconment_id] => 2
  [1] => 
  [testconment_userid] => 
  [2] => 2
  [testconment_testid] => 2
  [3] => 
  [testconment_typeid] => 
  [4] => 
  [testconment_flag] => 
  [5] => 你好啊啊啊啊
  [testconment_content] => 你好啊啊啊啊
  [6] => 2012-05-02 05:25:03
  [testconment_date] => 2012-05-02 05:25:03
)

通过循环取值
foreach($commentList as $v){
$commentTemp["id"]=$v["testconment_id"];
$commentTemp["userid"]=$v["testconment_userid"];
$commentTemp["testid"]=$v["testconment_testid"];
$commentTemp["typeid"]=$v["testconment_typeid"];
$commentTemp["flag"]=$v["testconment_flag"];
$commentTemp["content"]=$v["testconment_content"];
$commentTemp["date"]=$v["testconment_date"];
array_push($commentArray,$commentTemp);
}
我将$commentArray打印出来
Array
(
  [0] => Array
  (
  [id] => 2
  [userid] => 2
  [testid] => 2
  [typeid] => 2
  [flag] => 2
  [content] => 2
  [date] => 2
  )
 
  [1] => Array
  (
  [id] => 2
  [userid] => 2
  [testid] => 2
  [typeid] => 2
  [flag] => 2
  [content] => 2
  [date] => 2
  )
 
  [2] => Array
  (
  [id] => 
  [userid] => 
  [testid] => 
  [typeid] => 
  [flag] => 
  [content] => 
  [date] => 
  )
 
  [3] => Array
  (
  [id] => 
  [userid] => 
  [testid] => 
  [typeid] => 
  [flag] => 
  [content] => 
  [date] => 
  )
 
  [4] => Array
  (
  [id] => 2
  [userid] => 2
  [testid] => 2
  [typeid] => 2
  [flag] => 2
  [content] => 2
  [date] => 2
  )
 
  [5] => Array
  (
  [id] => 2
  [userid] => 2
  [testid] => 2
  [typeid] => 2
  [flag] => 2
  [content] => 2
  [date] => 2
  )
 
  [6] => Array
  (
  [id] => 
  [userid] => 
  [testid] => 
  [typeid] => 
  [flag] => 
  [content] => 
  [date] => 
  )
 
  [7] => Array
  (
  [id] => 
  [userid] => 
  [testid] => 

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

解決方法:您的組織要求您更改 PIN 碼 解決方法:您的組織要求您更改 PIN 碼 Oct 04, 2023 pm 05:45 PM

解決方法:您的組織要求您更改 PIN 碼

Windows 11 上調整視窗邊框設定的方法:變更顏色和大小 Windows 11 上調整視窗邊框設定的方法:變更顏色和大小 Sep 22, 2023 am 11:37 AM

Windows 11 上調整視窗邊框設定的方法:變更顏色和大小

如何在 Windows 11 上變更標題列顏色? 如何在 Windows 11 上變更標題列顏色? Sep 14, 2023 pm 03:33 PM

如何在 Windows 11 上變更標題列顏色?

Windows 11 上啟用或停用工作列縮圖預覽的方法 Windows 11 上啟用或停用工作列縮圖預覽的方法 Sep 15, 2023 pm 03:57 PM

Windows 11 上啟用或停用工作列縮圖預覽的方法

OOBELANGUAGE錯誤Windows 11 / 10修復中出現問題的問題 OOBELANGUAGE錯誤Windows 11 / 10修復中出現問題的問題 Jul 16, 2023 pm 03:29 PM

OOBELANGUAGE錯誤Windows 11 / 10修復中出現問題的問題

華為GT3 Pro和GT4的差異是什麼? 華為GT3 Pro和GT4的差異是什麼? Dec 29, 2023 pm 02:27 PM

華為GT3 Pro和GT4的差異是什麼?

Windows 11 上的顯示縮放比例調整指南 Windows 11 上的顯示縮放比例調整指南 Sep 19, 2023 pm 06:45 PM

Windows 11 上的顯示縮放比例調整指南

10種在 Windows 11 上調整亮度的方法 10種在 Windows 11 上調整亮度的方法 Dec 18, 2023 pm 02:21 PM

10種在 Windows 11 上調整亮度的方法

See all articles