Code: Select all
%data = funcThatMakeArrays();
echo(%data[1, "index2"]);
Code: Select all
%data = funcThatMakeArrays();
echo(%data[1, "index2"]);
May I have an example?What about array objects?
new ArrayObject(numArray); numArray.add(1,4); numArray.add(2,3); numArray.add(3,8); numArray.add("1,1",5); numArray.add("1,2",9); function ArrayObject::getKeyFromValue(%this,%value){ return %this.getKey(%this.getIndexFromValue(%value)); } function ArrayObject::getValueFromKey(%this,%key){ return %this.getValue(%this.getIndexFromKey(%key)); } numArray.getValueFromKey(1); // will return 4 numArray.getValueFromKey("1,1"); // will return 5