I am getting "Undefined Index FruitOrder" in an if statement for an array which is created from XML/Soap Response
Code:
$response = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $resp);
$xml = new SimpleXMLElement($response);
$body = $xml->xpath('//soapBody ')[0];
$array = json_decode(json_encode($body), TRUE);
if($array['FruitOrder']['FruitCode'] == 'FruitSuccess' || $array['FruitOrder']['FruitCode'] == 'FruitSuccessWarnings')
{