I need to get a value from an array the array is made like this
$resultOfAdd[“CaseAndMatterResult”][“ResultInfo”][“ReturnCode”];
and it gives an output of this
Array (
[AddCaseAndMatterResult] => Array (
[ResultInfo] => Array (
[ReturnCode] => OK
[Errors] =>
[Warnings] =>
)
[CaseID] => 4880062
[MatterID] => 4950481
[LeadID] => 0
[CustomerID] => 0
)
)
All I want to do is put the part "MatterID" into a variable. how would I achieve this.
I have tried
$matterID = array($resultOfAdd["MatterID"]);
and this does not work.
This is a multi-dimensional, associative array. Think of it like floors of a building. The key
MatterIDdoes not live in the first dimension (floor), rather on the second, in theAddCaseAndMatterResultsub-array.Successive dimensions of an array are specified with successive square-brackets, each naming the key to look in (this is true of most languages).