Log in

View Full Version : PHP array()



itxen
06-09-2010, 06:53 AM
Definition and Usage

array() creates an array, with keys and values. If you skip the keys when you specify an array, an integer key is generated, starting at 0 and increases by 1 for each value.


Example 1
<?php
$a=array("a"=>"Dog","b"=>"Cat","c"=>"Horse");
print_r($a);
?>

The output of the code above will be:
Array ( [a] => Dog [b] => Cat [c] => Horse )


Example 2
<?php
$a=array("Dog","Cat","Horse");
print_r($a);
?>

The output of the code above will be:
Array ( [0] => Dog [1] => Cat [2] => Horse )


visit us:
[SPAM REMOVED]

infocusweb
06-09-2010, 08:52 AM
hello friend
i am jaydeep dave. i am working as php web development. i need help that i want to create dynamic category so how i create which can i added through database.

djr33
06-09-2010, 06:24 PM
The post that you replied to is spam. I removed the spam link, but I left this thread so that I did not delete your question, but I am going to CLOSE this conversation because you should start a new topic for your question. Also, please post more information. Are you using a database? Is this related to arrays? What are your goals? Can you link to your website?