Quantcast
Channel: Programação - GUJ
Viewing all articles
Browse latest Browse all 33093

Como pegar um elemento especifico de um array? PHP

$
0
0

@GabrielQueiroz escreveu:

É o seguinte pessoal, tenho o seguinte código:

<?php

require '../model/dao.php';
require '../model/model.clientes.php';
require '../controller/controller.clientes.php';

$get_IdCliente = $_GET['id'];

$cliente = new ClienteController();
$retorno = $cliente->selectId($get_IdCliente);

exit(var_dump($retorno));

if (count($retorno) > 0)
{
   "echo" O QUE QUE EU PRECISO COLOCAR PRA PEGAR UM ELEMENTO DO ARRAY?
}
else
{
    header("Location: clienteTabela.php");    
}

?>

E imprimi isso:

array (size=1)
  0 => 
    object(stdClass)[5]
      public 'id_cliente' => string '2' (length=1)
      public 'nome_cliente' => string 'Luke Skywalker' (length=14)
      public 'datacad_cliente' => string '31/10/2016' (length=10)
      public 'email_cliente' => string 'lukeskywalker@suporte.com.br' (length=28)
      public 'telefone_cliente' => string '(40)24594305' (length=12)
      public 'cep_cliente' => string '34259306' (length=8)
      public 'endereco_cliente' => string 'Alderaan' (length=8)
      public 'numero_cliente' => string '149' (length=3)
      public 'complemento_cliente' => string 'Nave' (length=4)
      public 'bairro_cliente' => string 'Yavin' (length=5)
      public 'cidade_cliente' => string 'Endor' (length=5)
      public 'estado_cliente' => string 'IP' (length=2)
      public 'status_cliente' => string '1' (length=1)

É o seguinte, queria saber como pegar cada um dos elementos do array, por exemplo:
Queria imprimir pro usuário algo assim:

Seu ID é: 2
Seu Nome é: Luke Skywalker
Você se cadastrou em: 31/10/2016

.....

E para aparecer este "2", este "Luke Skywalker", este "31/10/2016" eu precisaria pegar o valor do 'id_cliente', 'nome_cliente', 'datacad_cliente', como faço para pegar estes itens específicos?

Mensagens: 2

Participantes: 1

Ler tópico completo


Viewing all articles
Browse latest Browse all 33093


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>