I realise I'm talking to myself now, but I've figured it out and am posting it in case others find this topic:
The result is a multidimensional array, so you need to get through all the array's to get the key you want - in this case the status message.
To get the array key statusmsg
from the array:
Array ( [result] => Array (
[0] => Array (
[statusmsg] => Sorry, that username (testingw) is reserved.
[status] => 0
[rawout] =>
[options] =>
)
)
)
You need to echo out: $result[result][0]['statusmsg']
You can then also do more error checking with the status
key, as it will be 1 or 0 for pass or fail, respectively.
*(Thanks to Mike above for getting me on the right track with the json_decode array flag.)*