I looked into PHP library and found that there's no equivalent of the following code in PHP. I want to remove an item from a list using PHP. Is there any possibility?
mixpanel.people.remove('School', 'UCB');
I looked into PHP library and found that there's no equivalent of the following code in PHP. I want to remove an item from a list using PHP. Is there any possibility?
mixpanel.people.remove('School', 'UCB');
There is a remove method in the latest Producers_MixpanelPeople class. Here's the method signature;
public function remove($distinct_id, $props, $ip = null, $ignore_time = false) {)
Ref: https://github.com/mixpanel/mixpanel-php/blob/master/lib/Producers/MixpanelPeople.php
Hi
I've created a duplicate of append() method and replaced '$append' with '$remove' and able to remove the list item from comma separated property. I think this method should be a part of main repository as well. Here's complete source code.
public function removeListItem($distinct_id, $prop, $val, $ip = null, $ignore_time = false) {
$operation = gettype($val) == "array" ? '$union' : '$remove';
$payload = $this->_constructPayload($distinct_id, $operation, array("$prop" => $val), $ip, $ignore_time);
$this->enqueue($payload);
}
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.