php delete element by value
$colors = array("blue","green","red");
//delete element in array by value "green"
if (($key = array_search("green", $colors)) !== false) {
unset($colors[$key]);
}
php delete element by value
$colors = array("blue","green","red");
//delete element in array by value "green"
if (($key = array_search("green", $colors)) !== false) {
unset($colors[$key]);
}
unset by key name php
unset($array['key-here']);
remove key of an array php
$result_Member = $this->Member->get_list_member_belong_to_company($id);
/*
$result_Member = array(
[10] => 10,
[20] => 11,
[30] => 12,
)
*/
// remove key, get values only
$member_ids = array_values($result_Member);
/*
$result_Member = array(
[0] => 10,
[1] => 11,
[2] => 12,
)
*/
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us