<?php

$word = "it's not big deal";
$input      = strtolower($word);
$split      = preg_split('/\s+/', $input);
$length     = count($split);

$neg = "NOT_";
for ($x=0; $x<$length; $x++){
    if (preg_match("/\bNOT\b/i",$split[$x])){
        $y=$x+1;
        $split[$x]      = "{$neg}{$split[$y]}";
        unset($split[$y]);
    }
}
$word = implode(" ",$split);
echo $word;

?>