Welcome Guest, Not a member yet? Register   Sign In
Run multiple form validation from config file
#2

[eluser]helmutbjorg[/eluser]
I think I understand your question... When doing a comparison using && or || PHP will only work as hard as it has to.

For example

Code:
// For this example we'll set $var equal to 1
$var = 1;

// In this condition both checks will occur
if($var == 1 && $var == 2) { }

// In this condition only the first one will be checked because the condition is already true and
// php will save time becuase it no longer matters if $var == 2 because it won't change the result
if($var == 1 || $var == 2) { }

// In this condition both vars will be checked because the condition may still be true
if($var == 2 || $var == 1) { }

Hope that helps!


Messages In This Thread
Run multiple form validation from config file - by El Forum - 07-18-2009, 02:42 PM
Run multiple form validation from config file - by El Forum - 07-19-2009, 12:39 AM
Run multiple form validation from config file - by El Forum - 07-19-2009, 12:41 AM
Run multiple form validation from config file - by El Forum - 07-19-2009, 05:14 AM
Run multiple form validation from config file - by El Forum - 07-20-2009, 02:58 AM
Run multiple form validation from config file - by El Forum - 07-20-2009, 03:28 AM
Run multiple form validation from config file - by El Forum - 07-20-2009, 03:35 AM
Run multiple form validation from config file - by El Forum - 07-20-2009, 03:37 AM
Run multiple form validation from config file - by El Forum - 07-20-2009, 03:49 AM
Run multiple form validation from config file - by El Forum - 07-27-2009, 05:22 PM
Run multiple form validation from config file - by El Forum - 07-27-2009, 10:13 PM
Run multiple form validation from config file - by El Forum - 07-27-2009, 10:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB