*

pitbull

  • ***
  • 98 posts
Need help to get region name by city name
« 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
« Last Edit: September 27, 2019, 06:04:46 PM by pitbull »

*

MB Themes

Re: Need help to get region name by city name
« Reply #1 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'];
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots