Jump to content

clean content for rss feed


raimis100

Recommended Posts

Yea i am dumb , I know!

 

This is what I did :P

 


Function IsValid ($data)
{
   $chars[0] = "q"; 
   $chars[1] = "w"; 
   $chars[2] = "e"; 
   $chars[3] = "r"; 
   $chars[4] = "t"; 
   $chars[5] = "y"; 
   $chars[6] = "u"; 
   $chars[7] = "i"; 
   $chars[8] = "o"; 
   $chars[9] = "p"; 
   $chars[10] = "a"; 
   $chars[11] = "s"; 
   $chars[12] = "d"; 
   $chars[13] = "f"; 
   $chars[14] = "g"; 
   $chars[15] = "h"; 
   $chars[16] = "j"; 
   $chars[17] = "k"; 
   $chars[18] = "l"; 
   $chars[19] = "z"; 
   $chars[20] = "x"; 
   $chars[21] = "c"; 
   $chars[22] = "v"; 
   $chars[23] = "b"; 
   $chars[24] = "n"; 
   $chars[25] = "m"; 
   $chars[26] = "1"; 
   $chars[27] = "2"; 
   $chars[28] = "3"; 
   $chars[29] = "4"; 
   $chars[30] = "5"; 
   $chars[31] = "6"; 
   $chars[32] = "7"; 
   $chars[33] = "8"; 
   $chars[34] = "9"; 
   $chars[35] = "0"; 
   $chars[35] = "."; 
   $chars[35] = "!"; 
   $chars[35] = "?"; 
   $chars[35] = " "; 
   $chars[36] = "!"; 
   $chars[37] = "."; 
   $chars[38] = "?"; 
   
   For ($I = 0;$I < count ($chars) ; $I++ ) {
     If (strtolower($data) == $chars[$I])
     {
       return true;
       break;
     }
   }
}

  Function CleanFeeds ($data)
  {
    for ($I = 0;$I < strlen ($data) ; $I++ ) {
    	$string = substr ($data, $I, 1);
    	If (IsValid ($string) == true)
    	{
        $all = $all . $string;
      }
    }
    return $all;
  }

 

I did it in hard way but atleast it works :P

 

And ye a, thanks for help guys :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.