src/Alchemy/Geonames/Connector.php
public function search($place, $limit = 40, $clientIp = null)
    {
        $parameters = array(
            'sort'  => 'closeness',
            'name'  => $place,
            'limit' => $limit,
        );

        if ($clientIp) {
            $parameters['client-ip'] = $clientIp;
        }

        $result = $this->get('city', $parameters);

        return array_map(function ($geoname) {
            return new Geoname($geoname);
        }, $result);
    }
public function search($place, $limit = 40, $clientIp = null)
    {
        $parameters = array(
            'sort'  => 'closeness',
            'name'  => $place,
            'limit' => $limit,
        );

        if ($clientIp) {
            $parameters['client-ip'] = $clientIp;
        }

        $result = $this->get('city', $parameters);

        return array_map(function ($geoname) {
            return new Geoname($geoname);
        }, $result);
    }
public function search ( $ place , $ limit = 40 , $ clientIp = null ) { $ parameters = array ( 'sort' => 'closeness' , 'name' => $ place , 'limit' => $ limit , ) ; if ( $ clientIp ) { $ parameters [ 'client-ip' ] = $ clientIp ; } $ result = $ this -> get ( 'city' , $ parameters ) ; return array_map ( function ( $ geoname ) { return new Geoname ( $ geoname ) ; } , $ result ) ; }
Search for a place by its name.

@param string  $place
@param integer $limit
@param string  $clientIp

@return array

@throws Exception
Search for a place by its name .