@@ 1192-1203 (lines=12) @@ | ||
1189 | $keys = array_keys($array); |
|
1190 | ||
1191 | // and do a lookup of the key passed |
|
1192 | if (($index = array_search($key, $keys, $strict)) === false) |
|
1193 | { |
|
1194 | // key does not exist |
|
1195 | return false; |
|
1196 | } |
|
1197 | ||
1198 | // check if we have a previous key |
|
1199 | elseif (! isset($keys[$index - 1])) |
|
1200 | { |
|
1201 | // there is none |
|
1202 | return null; |
|
1203 | } |
|
1204 | ||
1205 | // return the value or the key of the array entry the previous key points to |
|
1206 | return $getValue ? $array[$keys[$index - 1]] : $keys[$index - 1]; |
|
@@ 1233-1244 (lines=12) @@ | ||
1230 | $keys = array_keys($array); |
|
1231 | ||
1232 | // and do a lookup of the key passed |
|
1233 | if (($index = array_search($key, $keys, $strict)) === false) |
|
1234 | { |
|
1235 | // key does not exist |
|
1236 | return false; |
|
1237 | } |
|
1238 | ||
1239 | // check if we have a previous key |
|
1240 | elseif (! isset($keys[$index + 1])) |
|
1241 | { |
|
1242 | // there is none |
|
1243 | return null; |
|
1244 | } |
|
1245 | ||
1246 | // return the value or the key of the array entry the previous key points to |
|
1247 | return $getValue ? $array[$keys[$index + 1]] : $keys[$index + 1]; |