|
PHP associative arrays are really hash tables underneath, so if you have a lot of valid values or a lot of values to validate it's going to faster to search by key not by value:php:<? $acceptableValues=Array( "value1"=>1, "value2"=>1, "value3"=>1, "value4"=>1, "value5"=>1, ... ); ... $val=$_REQUEST["something"]; if (isset($acceptableValues[$val])) // valid else //invalid ...?> But if you only have few values to check and you're only calling it once then use whatever code is clearest.
|
# ¿ Mar 26, 2010 10:41 |
|
|
# ¿ May 16, 2024 11:54 |
|
drcru posted:As long as you're not storing credit card information in your database or working for a bank, you should be fine with just salting your hashes. Try and have a different salt for every person though.
|
# ¿ May 17, 2010 08:54 |