php - display elemenrt of array error -


array in php generate error

$array[]= array("usman","ali");       echo $array[0]; 

it return error notice: array string conversion in d:\xx\xamp\htdocs\array.php on line 2 array plz wrong these code of block.but i'm wanted create array , display there element... these line of code copy php.net , wroking fine.

$array = array("foo", "bar", "hello", "world");     echo $array[0]; 

the line:

$array[]= array("usman","ali"); 

doesn't think - add new element $array variable contains array.

to define new 1d array try instead:

$array = array("usman","ali"); 

or see structure of 2d array created this:

print_r($array); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -