Re: [PHP-DB] VAR_DUMP INTO PHP VARIABLES

[email protected] (Toby Hart Dyke) Thu, 19 Jun 2014 10:09:09 -0400
Newsgroups php.db
Message-ID <[email protected]>

My error! This:

$responseCode = $result[return]['responsecode'];

should have been

$responseCode = $result['return']['responsecode'];


The other responses have been rather more elegant, though I think my 
solution is a little more readable - i.e., I had to think about what was 
happening for those ones!

   Toby

On 6/19/2014 9:50 AM, Oriole Computing wrote:
> Hi Toby,
>
> my response is in variable $result so i run the code as below
>
> $responseCode = $result[return]['responsecode'];
>
> but getting this error: PHP Parse error:  syntax error, unexpected
> T_RETURN, expecting ']
>
> Warm Regards
>
>
>
> *SUPPORT TEAMORIOLE COMPUTING*
>
> *1938 B1 MUNGWI ROAD*
>
> *LUSAKAZAMBIA*
>
> *Skype:* oriolecomputing | *Url:* oriolecomputing.blogspot.com
> <http://generalcomputing.blogspot.com/>
>
>
> On Thu, Jun 19, 2014 at 12:23 PM, Pritoj Singh <[email protected]> wrote:
>
>> foreach($arr['return'] as $key=>$val){
>> $$key=$val;
>> }
>>
>>
>> On Thu, Jun 19, 2014 at 3:48 PM, Toby Hart Dyke <[email protected]> wrote:
>>
>>> If you have the response in a variable, $response:
>>>
>>> $responseCode = $response[return]['responsecode'];
>>> $responseMessage = $response[return]['responseMessage'];
>>> $transactionID = $response[return]['transactionID'];
>>>
>>>