Page 1 of 1

How to get the data on my array

Posted: Tue Jan 24, 2012 7:51 am
by kosaks
Hello all..

I have here my array results.. does anyone knows how to simplify this array? i would like to get the following value and echo it...

Code: Select all

Array 
( 
	[GetSMSInboundResponse] => Array 
		( 
			[Transaction] => Array 
				( 
					[Code] => 1 
					[Description] => Transaction OK 
				) 
			[SMSInbounds] => Array 
				( 
					[InboundSMS] => Array 
						( 
							[0] => Array 
								( 
									[ID] => 3126861 
									[Originator] => +447537404702 
									[Destination] => +447537404702 
									[Keyword] => UCB2 
									[Date] => 2012-01-24 
									[Time] => 13:21:45 
									[Body] => UCB2 this is a "quotes", single quote... Test for receiving a message having commas, double quotes and single quote... 
								) 
							[1] => Array 
								( 
									[ID] => 3126867 
									[Originator] => +447537404702 
									[Destination] => +447537404702 
									[Keyword] => UCB2 
									[Date] => 2012-01-24 
									[Time] => 13:21:45 
									[Body] => UCB2 this is a "quotes", single quote... Test for receiving a message having commas, double quotes and single quote 2... 
								) 
						) 
				) 
		) 
) 
In this section of the array this is where i would get and echo the results..

Code: Select all

[0] => Array 
	( 
		[ID] => 3126861 
		[Originator] => +447537404702 
		[Destination] => +447537404702 
		[Keyword] => UCB2 
		[Date] => 2012-01-24 
		[Time] => 13:21:45 
		[Body] => UCB2 this is a "quotes", single quote... Test for receiving a message having commas, double quotes and single quote... 
	) 
[1] => Array 
	( 
		[ID] => 3126867 
		[Originator] => +447537404702 
		[Destination] => +447537404702 
		[Keyword] => UCB2 
		[Date] => 2012-01-24 
		[Time] => 13:21:45 
		[Body] => UCB2 this is a "quotes", single quote... Test for receiving a message having commas, double quotes and single quote 2... 
	) 
But i have problems on how to do this. Im not that familiar of getting or echoing the values of a multidimentional array.. Please help me guys.,

Thanks

Re: How to get the data on my array

Posted: Tue Jan 24, 2012 10:09 am
by twinedev

Code: Select all

$aryInside = $aryResult['GetSMSInboundResponse']['SMSInbounds']['InboundSMS'];
Now, $aryInside will be the second block you listed.

Re: How to get the data on my array

Posted: Tue Jan 24, 2012 1:40 pm
by kosaks
Hello sir

Can you help me where specifically will i put $aryInside = $aryResult['GetSMSInboundResponse']['SMSInbounds']['InboundSMS']; into the code?

thanks in advance

Re: How to get the data on my array

Posted: Tue Jan 24, 2012 4:10 pm
by twinedev
Well, since I don't know what the code is, I'd have to guess at "somewhere between <?php and ?>" ;-) serious, without knowing what the code is you are using, can't tell ya.

-Greg