Osclass Support Forums

Osclass theme support => Stela Osclass Theme => Topic started by: pitbull on September 27, 2019, 05:29:39 PM

Title: Need help to get region name by city name
Post by: pitbull on September 27, 2019, 05:29:39 PM
Hello @Frosticek.

Last two days i m struggling to make this work:

What i want is to get a list(array) of cities and the regions they belong and display it at the footer.
For example as simple as that: Manhattan(New York), Miami(Florida), Los Angeles(California)


I know how to output a list of cities or regions array separately but how can i combine them in a single array????

Please help!

Regards
Title: Re: Need help to get region name by city name
Post by: MB Themes on September 30, 2019, 04:14:16 PM
@pitbull
If you have variable $city having all the information.

Code: [Select]
$region = Region::newInstance()->findByPrimaryKey($city['fk_i_region_id']);
echo $region['s_name'];