kusha Posted May 19, 2011 Share Posted May 19, 2011 Hi, Need help in parsing the . I am new to php and need to parsing and print only few elements in the arrary I have an array as below: Array ( [@attributes] => Array ( [WARRANTYCATEGORY] => Customer Warranty [NA_RATING] => [TAGCATEGORY1] => [TAGCATEGORY1DESC] => [TAGCATEGORY2] => [RESPONSEDATE] => 08-14-2006 04:40:40 PM [CASEID] => 1435435 [DUTYMANAGERAPPROVALTEXT] => [COUNTER] => 0 [DESCRIPTION] => SPRLSL:Cluster Notification [NA_BUGNO] => [PRIORITY] => 3 [WARRANTYPRODUCT] => WARR36MTH_HW_DISK [NA_DISRUPTION_EVENT] => [sERIALNUMBER] => 123456789 [NADUPCASEID] => [DMGERAPPRL] => [sYSNAME] => REWSRAPP34 [DATECLOSED] => 08-17-2006 04:47:37 PM [CASE_STATUSTEXT] => Closed [NASUPPORTOFFERING] => ST [CREATEDBY] => ) ) I need to access only CASEI D, CASE_STATUSTEXT and DATECLOSED from the above array How can I access that ? Thanks and Regards, Usha Quote Link to comment https://forums.phpfreaks.com/topic/236892-parsing-an-array/ Share on other sites More sharing options...
requinix Posted May 19, 2011 Share Posted May 19, 2011 Have you read through this yet? That should give you most of the information you need. The rest is the fact that print_r's output for arrays looks like "[key] => value" for each item within. Quote Link to comment https://forums.phpfreaks.com/topic/236892-parsing-an-array/#findComment-1217713 Share on other sites More sharing options...
kusha Posted May 19, 2011 Author Share Posted May 19, 2011 Hi Guruji, Finally I got it $finarr =($outputdata["@attributes"]); print_r($finarr["WARRANTYCATEGORY"]); Thanks for the answer. Thanks and Regards, Usha Quote Link to comment https://forums.phpfreaks.com/topic/236892-parsing-an-array/#findComment-1217724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.