I use TPP API
for check domain availability and domain register but i receive response in string
.
Get Session, return string
OK: t73484678463765
Domain check, return string
woohoo123.nz: OK: Minimum=1&Maximum=2
In other case, return string
woohoo123.nz: ERR: 102, This is message
When It return OK
it has &
in child but when ERR
that time it has ,
I want convert return string
into array
such as input woohoo123.nz: OK: Minimum=1&Maximum=2
and output following array
[
'woohoo123.nz' => [
'OK' => [
'Minimum' => 1,
'Maximum' => 2,
]
]
]
input woohoo123.nz: ERR: 102, This is message
and output following array
[
'woohoo123.nz' => [
'ERR' => [
'code' => 102,
'message' => 'This is message',
]
]
]
I like more to reuse code, I prefer recursive
and callback
but not sure in this case.