suppose I have $str=\"nikparsa neginnikparsa somenikparsa\" when I use
$str=\"nikparsa neginnikparsa somenikparsa\"
$str= str_replace(\'nikparsa\', \'nik parsa\', $str); echo $str;
Well, if you really don't want to use preg_replace, then:
substr( str_replace( ' stackoverflow ', ' do you see the apples? ', " $str "), 1, -1 );
Read the comments about its limitations :)
Use preg_replace:
$str = preg_replace('/\bnikparsa\b/i', 'nik parsa', $str);