During development, the solution is to fix the error, not ignore it. That is, why is the variable undefined? Maybe you are trying to access an element of the $GET or $POST superglobal arrays, and so you should check with [man]isset[/man] or [man]empty[/man] before accessing them.
In production, the solution is to set display_errors to off, and log errors instead. Error reporting should be kept at a reasonably high level.