When retrieved, tags are sorted in decreasing order (i.e. highest first) by the number of links that use the tag.
Example 819. Working With Tags
<?php
$simpy = new Zend_Service_Simpy('yourusername', 'yourpassword');
/* Save a link with tags */
$simpy->saveLink(
'Zend Framework' // Title
'http://framework.zend.com', // URL
Zend_Service_Simpy_Link::ACCESSTYPE_PUBLIC, // Access Type
'zend, framework, php' // Tags
);
/* Get a list of all tags in use by links and notes */
$tagSet = $simpy->getTags();
/* Display each tag with the number of links using it */
foreach ($tagSet as $tag) {
echo $tag->getTag();
echo ' - ';
echo $tag->getCount();
echo '<br />';
}
/* Remove the 'zend' tag from all links using it */
$simpy->removeTag('zend');
/* Rename the 'framework' tag to 'frameworks' */
$simpy->renameTag('framework', 'frameworks');
/* Split the 'frameworks' tag into 'framework' and
'development', which will remove the 'frameworks' tag for
all links that use it and add the tags 'framework' and
'development' to all of those links */
$simpy->splitTag('frameworks', 'framework', 'development');
/* Merge the 'framework' and 'development' tags back into
'frameworks', basically doing the opposite of splitting them */
$simpy->mergeTags('framework', 'development', 'frameworks');




