2013-08-29 104 views
1
print_r($que); 

輸出的是:如何individualy訪問數組中的元素,並獲取它們

Array ([0] => Array ([0] => PHP allows you to send emails directly from a script [1] => How do you get information from a form that is submitted using the "get" method? [2] => In PHP you can use both single quotes () and double quotes (" ") for strings: [3] => What does php stands for ? [4] => The PHP syntax is most similar to: [5] => What is the correct way to connect to a MySQL database? [6] => What is the correct way to include the file "time.inc" ? [7] => In PHP, the die() and exit() functions do the exact same thing. [8] => All variables in PHP start with which symbol? [9] => Include files must have the file extension ".inc")) 

我需要打印每個元素。

LIKE $ que [0];和$ que [1];等等。

if if echo "$que[0]";輸出結果爲Array而不是PHP allows you to send emails directly from a script

回答

1

$que[0]是一個數組本身。要訪問第一個元素$que中的第一個元素,您需要執行$que[0][0]

+0

woh!得到了Thnx bro @xbonez – Aayush

相關問題