How to return and print a specific method?
<p>I have 2 methods in class.</p>

<p>The first method get <code>$id</code> to retrieve 3 parameters of a specific item via webservice. It's a webservice of a Real Estate system. I will use these 3 parameters to find related items.</p>

<p><strong>So far, all is ok.</strong></p>

<p>My problem is to return data of <code>resemblant()</code> method.</p>

<p>I instantiate the <code>object</code>, I sent the <code>$id</code> to <strong>features</strong> method and I registered the <strong>attributes</strong>.</p>

<p>The <code>$get</code> attribute return information but <code>$similar = $obj-&gt;resemblant()</code> has no return.</p>

<p>I'm learning.</p>

<blockquote>
  <p>How to return the <strong><em>data</em></strong> that is inside the method <code>resemblant()</code> in <code>$similar</code>?</p>
</blockquote>

<pre><code>&lt;?php 

require("Acesso.class.php");

class Semelhantes extends Acesso
{
    public function features($id)
    {
        $postFields  = '{"fields":["Codigo","Categoria","Bairro","Cidade","ValorVenda","ValorLocacao","Dormitorios","Suites","Vagas","AreaTotal","AreaPrivativa","Caracteristicas","InfraEstrutura"]}';
        $url         = 'http://danielbo-rest.vistahost.com.br/'.$this-&gt;vsimoveis.'/'.$this-&gt;vsdetalhes.'?key=' . $this-&gt;vskey;
        $url           .= '&amp;imovel='.$id.'&amp;pesquisa=' . $postFields;

        $ch = curl_init($url);
        curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
        curl_setopt( $ch, CURLOPT_HTTPHEADER , array( 'Accept: application/json' ) );
        $result = curl_exec($ch); 
        $result = json_decode($result, true);

        /**
         * Paramentros para filtrar semelhança
         * @var [type]
         */
        $fcidade    = str_replace(" ", "+", $result['Cidade']);
        $fdorms     = $result['Dormitorios'];
        $fvalor     = $result['ValorVenda'];

        return array(
            'cidade' =&gt; $fcidade, 
            'dorms' =&gt; $fdorms, 
            'valor' =&gt; $fvalor
        );

    }

    public function resemblant()
    {
        $get = $this-&gt;features($id);
        return $get['Cidade'];
    }

}

/* Chamando as funções em outra parte do sistema */
$obj        = new Semelhantes;
$features   = $obj-&gt;features(2);
$similar    = $obj-&gt;resemblant();
</code></pre>

<p><strong>Very thanks</strong></p>