w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Foreach through a range to manipulating a url for fetching data from a live CSV file

I rewrote the insertCompaniesByRange() method and now it works. This is how it looks:

public function insertCompaniesByRange($letters = array(),
$number = null) {
    if (is_array($letters) && $number && count($letters) ==
2) {
        $range = range($letters[0], $letters[1]);
        foreach ($range as $letter) {
            if ($this->getCompaniesByLetter($letter,$number)) {
                foreach($this->companyList as $company) {
                    $this->insertCompany($company);
                }
            }
        }
    }

    return false;
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.