Chapter

Non-Contiguous Indices

From ComputerScienceOne by Dr Chris Bourke

Concepts

  1. How can strings be used as indices in PHP arrays?

    "Since arrays in PHP are associative arrays, keys are not limited to integers. You can also use strings as keys to index elements.\n\n1 $arr = array();\n\n2 $arr[0] = 5;\n\n3 $arr[\"foo\"] = 10;\n\n4

  2. How can key-value pairs be initialized in a PHP array?

    "Since associative arrays in PHP can be indexed by either integers or strings and need not be ordered or contiguous, we can use a special key-value initialization syntax to define not only the values,

Non-Contiguous Indices | ComputerScienceOne | Bifalgorithm | Bifalgorithm