#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
#!/usr/bin/php <?php if (!isset($argv[1])) { die( 'Usage: ./wtop filename [lines] [filter]' . PHP_EOL . 'Use -1 lines for show all words' . PHP_EOL); } if (!file_exists($argv[1]) || !is_readable($argv[1])) { die( 'Data file not found or can not be read . PHP_EOL' ); } if (isset($argv[3])) { if (file_exists($argv[3]) && is_readable($argv[3])) { $filter = str_word_count(file_get_contents($argv[3]), 1); } else { die( 'Filter file not found or can not be read' . PHP_EOL); } } $lines = (isset($argv[2])) ? ( int ) $argv[2] : -1; $data = file_get_contents($argv[1]); $words = str_word_count($data, 1); foreach ($words as $word) { $word = strtolower($word); if (isset($filter) && in_array($word, $filter)) { continue ; } if (isset($result[$word])) { $result[$word] += 1; } else { $result[$word] = 1; } } arsort(&$result); foreach ($result as $word => $count) { if ($lines-- == 0) { break ; } echo $count . ' ' . $word . PHP_EOL; }
stream@sapphire:~/development$ cat text.txt
With PHP breaking new ground in the enterprise arena, the establishment of a rati-
fied certification was, some might say, inevitable. However, for me, it couldn't come
soon enough—and I was ecstatic when Zend launched their PHP 4 Certification.
With more than 1,500 certified engineers to date, there is no doubt that their en-
deavour has been a success.
Now, with the introduction of the long-awaited PHP 5 certification, Zend has once
again raised the bar for PHP developers everywhere. This examination is much
broader, and requires much more than just theoretical knowledge—in order to pass
the test, candidates need real-world knowledge in addition to a solid theoretical
background.
The effect of the PHP 5 certification, for me, is even more profound than that of
the original certification, and I believe that it will become the gold standard for those
looking to hire PHP-centric Web Developers. I think that it is apt to consider Zend's
work a job well done, and to applaud those who invest the time and effort needed to
become Zend Certified Engineers.
stream@sapphire:~/development$ cat filter.txt
a the
am are
i you we
stream@sapphire:~/development$ ./wtop text.txt 10 filter.txt
7 to
5 and
5 certification
5 php
4 for
4 is
4 that
4 of
4 zend
3 more
stream@sapphire:~/development$
Source: https://habr.com/ru/post/92770/
All Articles