I get string:
$res = "RESULT: SUCCESS
NUMBER_TYPE: 0";
I want get "RESULT" and for this i use explode:
$arr = explode('\n\r', $res);
$result = trim(explode('RESULT:', $arr[0]));
But i get Arrayfalse
Tell me please how correctly get RESULT?
P.S.: result should been SUCCESS
if (preg_match('/RESULT:\s*(\w+)/', $res, $match)) echo $match[1];- regular-expressions.infoexplode