So here I am, writing an app, creating a form with some very standard input fields like email, website, facebook, twitter, etc. and now I want to parse them all and check that the website input correctly begins with http(s)://, that the facebook link begins with http(s)://www.facebook.com, and so on.
So, I was wondering if you would know any library that would implement those functions ni开发者_开发知识库cely, I could reuse? I know it is quite common for email parsing for instance, so it must exist for general purpose, no?
As mentioned, php is my language, and cake is my friend.
Have a look at the Zend Framework and its Zend_Validate (and maybe also Zend_Form) component. Other libraries/frameworks propably have similar components, but I dont know them very well ;)
For a more low-level access to your problem, you can also look at PHPs own validate filters.
精彩评论