MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
How to insert Auto Tags with Aggregator?
AuthorText
ErEiSeR
Junior Member
ErEiSeR

Posts: 47
Contributes: 54

Gender: _MALE_
Online: No

Languages: Italian
Date: 04/03/2010 22:43
How to insert Auto Tags with Aggregator?
#post23628
how to add Tags in aggregator created from title?

code
function grabword($string){

      $stopWords = array('i','a','riguardo','un','una','e','sono','come','quando','essere','da parte','di','su','per','tra','fra','in','con','il','la','lo','la','gli','le','questo','questa','codesto','quello','dove');
   
      $string = preg_replace('/ss+/i', '', $string);
      $string = trim($string); // trim the string
      $string = preg_replace('/[^a-zA-Z0-9 -]/', '', $string); // only take alphanumerical characters, but keep the spaces and dashes too…
      $string = strtolower($string); // make it lowercase
   
      preg_match_all('/b.*?b/i', $string, $matchWords);
      $matchWords = $matchWords[0];
     
      foreach ( $matchWords as $key=>$item ) {
          if ( $item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) {
              unset($matchWords[$key]);
          }
      }   
      $wordCountArr = array();
      if ( is_array($matchWords) ) {
          foreach ( $matchWords as $key => $val ) {
              $val = strtolower($val);
              if ( isset($wordCountArr[$val]) ) {
                  $wordCountArr[$val]++;
              } else {
                  $wordCountArr[$val] = 1;
              }
          }
      }
      arsort($wordCountArr);
      $wordCountArr = array_slice($wordCountArr, 0, 10);
      return $wordCountArr;
  }


this function grab the word from title but i don't know how to insert in database help me!

sorry from my bad english Smile
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.232

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo