answersLogoWhite

0


Best Answer

A key is the name of a variable in an array ($array["key"]) and the index is the position it's at ($array = ["key" => 0], the index would be 0).

Keys and indices are the same if the array is not associative though ($array = [true], the key holding the value true is named 0 and is at index 0).

User Avatar

Wiki User

7y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is difference between key and index in php arrays?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Difference between Index File and Index Sequential file?

index file is organized with the help of any key as index number at rondomly but index sequencial file organized with the help of any index sequentialy rajesh patel


What is the difference between primary key and unique index?

Primary key is a type of unique index with no null constraint on the columns involved. There can only be one Primary key whereas you can create other unique indexes on the table.


What is difference between sparse index and dense index?

Dense Index: An index record appears for every search key value in file. This record contains search key value and a pointer to the actual record. Sparse Index: Index records are created only for some of the records. To locate a record, we find the index record with the largest search key value less than or equal to the search key value we are looking for. We start at that record pointed to by the index record, and proceed along the pointers in the file (that is, sequentially) until we find the desired record. - - (ref: http://sawaal.ibibo.com/computers-and-technology/difference-between-sparce-index-dence-index-773764.html)


What is the key difference between a protosun and a sun?

what is the key difference between a protosun and the real sun?


What is the difference between a key and a legend?

There is no difference.


What is the difference between stored procedure and index?

A stored procedure is a precompiled set of SQL statements that can be executed repeatedly, helping to streamline database operations and improve performance. On the other hand, an index is a database structure that increases the speed of data retrieval operations by quickly locating the rows in a table. Stored procedures are used to encapsulate logic for performing tasks, while indexes are used to optimize data retrieval.


Difference between foreign key and composite key?

primary key: primary creates a clustered index on the column and it doesn't allow null values. unique key: unique key creates non clustered index by default.it allows "one null value". foreign key: A foreign key (FK) is a column or combination of columns used to establish and enforce a link between the data in two tables. Fore More information, you can visit this website:http://www.iyogibusiness.com


Another name for the primary key is the key?

Index key


Index and where it is located?

rend lake is located at what index key


What is the definition of a map index?

map index: Graphic key primarily designed to give the relationship between sheets of a series, their coverage, availability, and further information on the series.


What is the key difference between a liquid a gas?

intermolecular attractions


What is a key difference between a liquid and a gas?

intermolecular attractions