match all except some word

LuckyNeo

New Member
i'm looking for a way, to match all except the some word.please tell me how i must wrote it?when i wrote\[code\]$str = "i am a programmer";$word = "am";preg_match_all("/[^($word)]/", $str, $matched);// it do the same, if i when i wrotepreg_match_all("/[^$word]/", $str, $matched);\[/code\]i also tried \[code\]preg_match_all("/[^{$word}]/", $str, $matched);\[/code\] but it doesn't do the job.how can i tell all except that word ?Thanks Much
 
Back
Top