preg_match("#<N>(.+?)</N>#Ui", "I have <N>5</N> apples", $matches); $txt = $matches[1];
$string = "<N>dvir</N></N>";