- تاریخ ثبتنام
- 2020-06-26
- نوشتهها
- 21,420
- راهحلها
- 27
- پسندها
- 3,264
- امتیازها
- 113
- سن
- 27
- محل سکونت
- England
- وب سایت
- xenforo.xyz
I have an array of categories (around 2000)
I want to unset just one value in this array.
I can do now:
1.
Code:
2.
Because all indexes are unique and all category_ids are unique i could do:
$flippedCategories = array_flip($categories);
unset($flippedCategories[1]);
$categories = array_flip($flippedCategories);
3.
Maybe it is a better way to extend the repository from...
I want to unset just one value in this array.
I can do now:
1.
Code:
2.
Because all indexes are unique and all category_ids are unique i could do:
$flippedCategories = array_flip($categories);
unset($flippedCategories[1]);
$categories = array_flip($flippedCategories);
3.
Maybe it is a better way to extend the repository from...
نام موضوع : Fastest way to find a value in an array