Answers for "remove key object php"

PHP
5

delete property from object php

unset($a->new_property);
Posted by: Guest on March-15-2020
1

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,
)
*/
Posted by: Guest on October-21-2020
0

remove field from object php

unset($a->new_property);
Posted by: Guest on December-03-2020

Browse Popular Code Answers by Language