我尝试了常规的 php unset,但没有成功。一切看起来都在这里,但它仍然在数组中
$profileID = $_POST['profileID'];
$userID = $_POST['userID'];
$reChkMetaValue = get_user_meta($userID,'friends',true);
foreach($reChkMetaValue as $key => $value) {
if( ( $key = array_search($profileID, $reChkMetaValue) ) !== false );
unset( $reChkMetaValue[$key] );
}