1
I’m developing a system that uses a web-service to recover the data needed to feed you, in the real estate segment. I am learning PHP and have many problems learning arrays. You could show me how I could recover specific data from this array: http://axitech.com.br/vista ...
Man print_r
is returning all records consulted, would like to be able to save CATEGORIA
BAIRRO
VALOR
within 3 different variables to be able to use them later. I imagine in this case we have a two-dimensional array, that’s it?
Evolution:
echo '<pre>'; print_r($res[523]['Data cadastro']); echo '</pre>';
With this code I can return a specific data from a specific record. But what if I wanted to return a specific data of all the elements? I tried the first empty Intel thinking that it would return me to Date registration of all records UNSUCCESSFUL:
echo '<pre>'; print_r($res[]['Data cadastro']); echo '</pre>';
This is the complete code of my script:
<?php
$array = array(
'key' => '',
'module' =>'imoveis',
'method' => 'busca_imoveis',
'field' => array(
'DATA' => 'Data cadastro',
'CODIGO' => 'Codigo',
'CATEGORIA' => 'Categoria',
'UF' => 'UF',
'CIDADE' => 'Cidade',
'BAIRRO' => 'Bairro',
'ENDERECO' => 'Endereco',
'NUMERO' => 'Numero',
'VLR_VENDA' => 'Valor',
'DORMITORIO' => 'Dormitorios',
'URL_FOTO' => 'Url',
'IMAGEM_G' => 'Foto'
),
'filter' => array(
'CONDICAO' => 'VLR_VENDA > 0'
)
);
$client = new SoapClient(null, array(
'uri' => 'http://soap.imo.bi/',
'location' => 'http://soap.imo.bi/soap.dll',
'trace' => 'trace'
));
$array['order'] = array('VLR_VENDA' => 'DESC');
//$array['limit'] = '0, 10';
$res = $client->get($array);
echo '<pre>';
print_r($res);
echo '</pre>';
?>
In case you need to ask these 3 fields of a single item or all of the array? ja tried one
foreach
?– rray
That one
print_r($res)
is returned to me all the items fromarray
with all its characteristics as shown in the link http://axitech.com.br/vista/index.php. I want to break this uparray
to be able to do whatever you want with this data.– Marcos Vinicius