$test123 = "<ssl_result_message>APPROVAL</ssl_result_message>";
$value = strstr($test123, "<ssl_result_message>"); //gets all text from <ssl_result_message> forward
$value = strstr($value, "</ssl_result_message>", true); //gets all text before </ssl_result_message>
echo $value,"<br>";
if ($value == 'APPROVAL') {
echo 'Transaction is APPROVED!';}
else{
echo 'Transaction is DECLINED';}
The echo value part echos "APPROVAL" just like I expected it to. But the if statement is not working. I keep getting mixed results. I have tried = == and === .
If i use $value = "APPROVAL"; instead of the test123 with strstr and test, it works as expected. What am I missing here?