$resultArray should be passed in as a reference.... &$resultArray