As of PHP 4.3.10 you can use a little know feature of isset to check to see if a string offset is present.
In there example they have:
Code: Select all
//$_POST[$k] is an address field
//$v = 255
if (!empty($_POST[$k]) && isset($_POST[$k]{$v + 1})) {
exit("{$k} is longer then the allowed {$v} length");
}