How do other developers solve this problem?
I've found a very practical solution on the .NET side of things is to use data annotations with MVC - which allows you to markup your model with metadata describing the shape of acceptable data and have it automagically validated on both client and server - but haven't found anything similar in PHP and other languages. Any recommendations?