I need to create an association between an Array and a Number; as PHP lacks a Map type, I am trying using an array to achieve this:
$rowNumberbyRow = array();
$rowNumberByRow[$rowData] = $rowNumber;
However, when I evaluate the code, I get the following Error:
Warning: Illegal offset type
Just to note, the data stored in the array ($rowData) does not have any 'unique' values that I can use as a key for the $rowNumberByRow Array.
Thanks!
UPDATE: To answer some of my commenters, I am trying to create a lookup table so that my application can find the row number for a given row in O(1) time.
$rowNumberByRow [ $rowData ['your_key'] ] = $rowNumber;