3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = ' { "VERSAO": "111111111111", "SOLICITACAO": { "S-CONSULTA": "333", "S-SOLICITANTE": "TESTE CONSULTA", "S-TIPO-CREDITO": "OU" }, "RESPOSTA": { "RESPOSTA-RETORNO": { "STATUS-RESPOSTA": "0", "MENSAGEM-RESPOSTA": "CONSULTA CONCLUIDA" }, "NUMERO-RESPOSTA": "XXXXXX-7", "ASSOCIADO-SOLICITANTE": "CONSULTAS", "NOME-CONSULTA": "SCPC BASICO", "IP-SOLICITANTE": "XXXXXX", "REGISTRO-ACSP-SPCA": { "CONSULTA": [ { "TIPO": "OU", "DESCRICAO": "OUTROS", "DATA": "20220223", "INFORMANTE": "XX-XX/CONSULTAS" }, { "TIPO": "CC", "DESCRICAO": "CARTAO CREDITO", "DATA": "20220106", "INFORMANTE": "XX-XX/XX" } ], "SINTESE": { "NOME": "XX XX DE SOUZA XX", "CPF": "11111111", "NASCIMENTO": "19871221", "MAE": "XX MARIA DE SOUZA XX" }, "DEBITO": { "TIPO": "OJ", "DESCRICAO": "XX-OUTRAS ATIVIDADES XX", "CONTRATO": "xx--contrato--xx", "DATA": { "REGISTRO": "20211221", "DISPONIVEL": "20220222" }, "MOEDA": "R$", "VALOR": "00000027885", "VALORN": "00,85", "SITUACAO": "COMPRADOR", "NEED": "XX PERNAMBUCO", "CIDADE": "XX SAO PAULO", "UF": "SP", "CONDICAO": "ATIVO" } } } } '; $json_decode = json_decode($json, true); $var = $json_decode['RESPOSTA']['REGISTRO-ACSP-SPCA']['DEBITO']; $valor_retorno = $var['NEED']; echo "Return:".$valor_retorno;
Output for git.master, git.master_jit, rfc.property-hooks
Return:XX PERNAMBUCO

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
84.42 ms | 1242 KiB | 4 Q