I have an api call which returns data
stdClass Object ( [data] => stdClass Object ( [TransactionId] => 10254 [RequestId] => 1548 [ResponseTime] => 0.161 [SSP] => test1542 [ErrorCode] => 0 [NREC] => 1 [BILREC] => 1 [TC] => 0 [USID] => BQ10 [ASInput] => stdClass Object ( [User] => test1254 [HostIP] => 124.1.1.1 [CS] => test [RId] => 16546asdfs [DPPAPurpose] => 2 [GLBPurpose] => 3 [PermissibleUseCode] => 3 [NumberOfRecords] => 100 [StartingRecord] => 1 [Version] => 32 [Address] => stdClass Object ( [Line1] => 125 main st [City] => BROOKLYN [State] => NY [Zip] => 11237 ) ) ) )
To prevent the multiple call to api for testing how can I convert this to regular php array object so that i can use this output coming in this format to a variable.
$string = "stdClass Object ( [data] => stdClass Object ( [TransactionId] => 10254 [RequestId] => 1548 [ResponseTime] => 0.161 [SSP] => test1542 [ErrorCode] => 0 [NREC] => 1 [BILREC] => 1 [TC] => 0 [USID] => BQ10 [ASInput] => stdClass Object ( [User] => test1254 [HostIP] => 124.1.1.1 [CS] => test [RId] => 16546asdfs [DPPAPurpose] => 2 [GLBPurpose] => 3 [PermissibleUseCode] => 3 [NumberOfRecords] => 100 [StartingRecord] => 1 [Version] => 32 [Address] => stdClass Object ( [Line1] => 125 main st [City] => BROOKLYN [State] => NY [Zip] => 11237 ) ) ) )"; $array_obj = somefunction($string);
Something like that.