Remove word that only 3 character or less with PHP
<p>i use a php class to make tag cloud from article, but i want to remove words that only 3 character or less, also remove numeric words.</p>

<p>example tags: 1111 monkey deer cat pig buffalo</p>

<p>i want result : monkey deer buffalo</p>

<p>PHP code from that class (full code <a href="http://code.google.com/p/web-information-systems/source/browse/trunk/SentimentAnalysisProject/Sukalp/cloud.php?r=36" rel="nofollow">here</a>)</p>

<pre><code>    function keywords_extract($text)
{
    $text = strtolower($text);
    $text = strip_tags($text);

    /* 
     * Handle common words first because they have punctuation and we need to remove them
     * before removing punctuation.
     */
    $commonWords = "'tis,'twas,a,able,about,across,after,ain't,all,almost,also,am,among,an,and,any,are,aren't," .
        "as,at,be,because,been,but,by,can,can't,cannot,could,could've,couldn't,dear,did,didn't,do,does,doesn't," .
        "don't,either,else,ever,every,for,from,get,got,had,has,hasn't,have,he,he'd,he'll,he's,her,hers,him,his," .
        "how,how'd,how'll,how's,however,i,i'd,i'll,i'm,i've,if,in,into,is,isn't,it,it's,its,just,least,let,like," .
        "likely,may,me,might,might've,mightn't,most,must,must've,mustn't,my,neither,no,nor,not,o'clock,of,off," .
        "often,on,only,or,other,our,own,rather,said,say,says,shan't,she,she'd,she'll,she's,should,should've," .
        "shouldn't,since,so,some,than,that,that'll,that's,the,their,them,then,there,there's,these,they,they'd," .
        "they'll,they're,they've,this,tis,to,too,twas,us,wants,was,wasn't,we,we'd,we'll,we're,were,weren't,what," .
        "what'd,what's,when,when,when'd,when'll,when's,where,where'd,where'll,where's,which,while,who,who'd," .
        "who'll,who's,whom,why,why'd,why'll,why's,will,with,won't,would,would've,wouldn't,yet,you,you'd,you'll," .

    $commonWords = strtolower($commonWords);
    $commonWords = explode(",", $commonWords);
    foreach($commonWords as $commonWord) 
    {
        $text = $this-&gt;str_replace_word($commonWord, "", $text);  
    }

    /* remove punctuation and newlines */
    /*
     * Changed to handle international characters
     */
    if ($this-&gt;m_bUTF8)
        $text = preg_replace('/[^\p{L}0-9\s]|\n|\r/u',' ',$text);
    else
        $text = preg_replace('/[^a-zA-Z0-9\s]|\n|\r/',' ',$text);

    /* remove extra spaces created */
    $text = preg_replace('/ +/',' ',$text);
    $text = trim($text);
    $words = explode(" ", $text);
    foreach ($words as $value) 
    {
        $temp = trim($value);
        if (is_numeric($temp))
            continue;
        $keywords[] = trim($temp);
    }
    return $keywords;
}
</code></pre>

<p>I've tried various ways, such as use <code>if (strlen($words)&lt;3 &amp;&amp; is_numeric($words)==true)</code>, but it did not work.</p>

<p>please help me</p>
