The comment by JavaFan provides a very short version, but that aside, having a variable named $flag is a really bad idea. Usually you use the name to describe the purpose of the variable, not the type. Otherwise you'll end up with names like $string, $string2, $number, $numbers and so forth. Knowing what you want $flag to do could in this case help simplifying your code even further.
In reply to Re: Looking for less code
by mzedeler
in thread Looking for less code
by Sun751
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |