function searchCompany($searchKey, $page = 0) { if ($page > 0) { $page = ($page - 1) * PAGE_BY; $limit = "LIMIT {$page}," . PAGE_BY; } $fields = array("companyName"); $companyRecords = new CompanyRecords(); if ($companyRecords->searchRecords($searchKey, $fields, $limit)) { if (!($domDoc = $companyRecords->getDomDocument())) { return false; } else { $xmlStr = $domDoc->dump_mem(true); return $xmlStr; } } else { return false; } }