$kelime2= "yalan dünya"; $bul = substr_count($kelime2, ' '); if($bul==0) { echo "xx"; } elseif($bul>=1) { echo "yy"; }