开发者

Spry framework vs regular expressions

what is difference b/w regular ex开发者_JAVA百科pression and spry validation. which is important, best, easy, and mostly used in php programming.


Spry is a Javascript library from Adobe. It happens to have a validation framework that can color fields based on whether or not they are valid, based upon complex criteria. It executes client-side only, and there is zero evidence that Spry's validation bits can make ajax calls to perform validation, nor is there any sign that it can use regular expressions for validation.

Regular expressions are a text matching syntax available in pretty much every single programming language on the face of the planet. It happens that you can use regular expressions to perform many validation tasks for form entry.

Your question can not be answered as you have phrased it: Spry has nothing to do with PHP, so there is no way to determine if it's the best or easiest way, though I can certainly say that, being a client-side thing, it's absolutely not the most used way to perform validation in PHP.

I'd wager that regexes are a few orders of magnitude more "important" than Spry with regard to validation.

Also, remember something very important: You need validation on the server side of things, even if you have client-side validation. Client-side validation can be bypassed and should not be blindly trusted by your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜