On Wed, 10 Nov 2004 11:00:12 -0800, Chris W. Parker <cparker@xxxxxxxxxxxx> wrote: > hi. > > call me stupid but i can't decide which option is better (actually don't > call me stupid because it will hurt my feelings and i might cry). and > having said that, maybe neither option is better than the other? > whatever the answer, i just want some outside input on this because for > some reason my brain is getting caught up on it and it's bothering me. > > should basic data validation come before a function call or be performed > within the function? I would do the validation inside the function. This avoids repeating the validation everywhere the function is called. It also makes the function more self-contained. It expects a certain input and complains, or returns false, if it doesn't get it. Brad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php