php数组的有关问题

WBOY
풀어 주다: 2016-06-13 13:33:20
원래의
953명이 탐색했습니다.

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] => 

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!