SAMConnection->subscribe
SAMMessage->body
SAM Functions
PHP Manual

# SAMConnection->unsubscribe

(PECL sam >= 0.1.0)

SAMConnection->unsubscribe — Cancel a subscription to a specified topic.

### Description

SAMConnection
bool unsubscribe ( string `$subscriptionId` [, string `$targetTopic` ] )

The "unsubscribe" method is used to delete an existing subscription to a specified topic.

### Parameters

`subscriptionId`

  The identifier of an existing subscription as returned by a call to the subscribe method.

### Return Values

This method returns `FALSE` if an error occurs.

### Examples

Example #1 Delete a subscription

`<?php
if (!$conn->unsubscribe($subid)) {
// The unsubscribe failed!
echo "Unsubscribe failed ($conn->errno) $conn->error";
}
?>`

### See Also

- SAMConnection->subscribe

SAMConnection->subscribe
SAMMessage->body
SAM Functions
PHP Manual