Click here to Skip to main content
15,902,634 members

Comments by D.sujith kumar (Top 2 by date)

D.sujith kumar 27-Jun-12 14:01pm View    
Hi this is my code:

$path="sa.doc";
$str = file_get_contents($path);

function count_words($string)
{
$string = htmlspecialchars_decode(strip_tags($string));
if (strlen($string)==0)
return 0;
$t = array(' '=>1, '_'=>1, "\x20"=>1, "\xA0"=>1, "\x0A"=>1, "\x0D"=>1, "\x09"=>1, "\x0B"=>1, "\x2E"=>1, "\t"=>1, '='=>1, '+'=>1, '-'=>1, '*'=>1, '/'=>1, '\\'=>1, ','=>1, '.'=>1, ';'=>1, ':'=>1, '"'=>1, '\''=>1, '['=>1, ']'=>1, '{'=>1, '}'=>1, '('=>1, ')'=>1, '<'=>1, '>'=>1, '&'=>1, '%'=>1, '$'=>1, '@'=>1, '#'=>1, '^'=>1, '!'=>1, '?'=>1); // separators
$count= isset($t[$string[0]])? 0:1;
if (strlen($string)==1)
return $count;
for ($i=1;$i
D.sujith kumar 27-Jun-12 13:45pm View    
i need step by step process.