My application is currently on java and I am sending a LinkedHashMap (getting Data from Excel) to a service. Now I am converting my application to php.
I need to create a LinkedHashMap in php.
String data[][]; // Excel data in the form of 2-D Array.
LinkedHashMap<Integer, ArrayList> mapToSend = null;
mapToSend = new LinkedHashMap<Integer, ArrayList>();
for (int i = 0; i < data[0].length; i++) {
ArrayList<String> ar = new ArrayList<String>();
for (int j = 0; j < numberOfRecords; j++) {
if (data[j][i] != null) {
data[j][i] = data[j][i].toString();
ar.add(data[j][i]); // Add in array through coloumnwise
} else {
ar.add("Empty");
}
}
mapToSend.put(i, ar); // making a map like {0=[coloumn data1],1=[coloumn data2]....}
}
This is how I create the map to sent to my service.
I am using PHPExcel to read data from Excel.
i need to create a map and send it to a service. please Suggest.
LinkedHashMapusing serialization. So how should the map be represented, and what have you tried to create such a representation using PHP?