Welcome Guest, Not a member yet? Register   Sign In
Problem creating a helper (Error undefined offset)
#3

[eluser]Pert[/eluser]
As array indexes could be anything, you can't trust count($array). You can have array that looks like this:
Code:
$array[1] = 'a';
$array[1000] = 'b';
$array[-1] = 'c';

Better option would be to check if array element has been set with said index and then do the check for array element value:
Code:
$found = isset($array[$v]) && $iten == $array[$v] ? true : '';


Messages In This Thread
Problem creating a helper (Error undefined offset) - by El Forum - 06-24-2013, 12:45 PM
Problem creating a helper (Error undefined offset) - by El Forum - 06-25-2013, 05:44 AM
Problem creating a helper (Error undefined offset) - by El Forum - 06-25-2013, 06:15 AM
Problem creating a helper (Error undefined offset) - by El Forum - 06-25-2013, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB