PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ewg   Parse keywords from text   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Parse keywords from text
Extract keywords from text file
Author: By
Last change: up
Date: 14 years ago
Size: 709 bytes
 

Contents

Class file image Download
<?
require 'text.class.php';

$text = new Text ('text.txt');
 
$start = microtime(true);
// Returns all words (array)
$get_all = $text->get_all ();
var_dump ($get_all);
echo
'<br>'.(microtime(true)-$start).'<hr><br>';
$start = microtime(true);

// Returns elements from 0 to 100 (array)
$get_limit = $text->get_limit (0, 100);
var_dump ($get_limit);
echo
'<br>'.(microtime(true)-$start).'<hr><br>';
$start = microtime(true);

// Returns elements frequency > 500 (array)
$get_count_limit = $text->get_count_limit (500);
var_dump ($get_count_limit);
echo
'<br>'.(microtime(true)-$start);

// Example ¹4
?>
<meta name="keywords" content="<?=implode (', ',$text->get_limit (0, 20));?>" />