A lot more context would be useful here. I think they don't have much in common, actually, besides that they both loop over a list. I think grep has more in common with map than foreach.
In reply to Re: Difference between foreach and grep
by kyle
in thread Difference between foreach and grep
by velusamy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |