Patch array-search-fix-fix-fix for Arrays related Bug #73843
Patch version 2016-12-30 09:12 UTC
Return to Bug #73843 |
Download this patch
Patch Revisions:
Developer: 376292871@qq.com
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', true);
// $arr = array(
// 0 => 241,
// 2 => 248,
// 3 => 249,
// 4 => 250,
// 5 => 255,
// 6 => 256,
// 7 => 257
// );
$arr = [241, 248, 249, 250, 255, 256, 257];
$except = [248, 249, 255];
foreach ($except as $value) {
if ($key = array_search($value, $arr) !== false) {
unset($arr[$key]);
}
}
print_r($arr);
exit;
|