Файл: seo.php
Строк: 35
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SeoHelper PHP Class Example</title>
</head>
<body>
<?php
/*
* We need to include the class at first
*/
include_once("seo.class.php");
/*
* We also need some text to work with
*/
$text = "Hello. <b>This</b> is gonna be <em>example</em> text including special characters like & & & © ©. Double spaces and more. We just want to get all they <u>keywords</u> right?"
. "Hello. <b>This</b> is gonna be <em>example</em> text including special characters like & & & © ©. Double spaces and more. We just want to get all they <u>keywords</u> right?";
?>
<b>Example text:</b><br>
<p>You can seee the text is full of HTML tags, HTML entities, doubles spaces and another garbage which can appear on any website.</p>
<code><textarea rows="30" cols="100"><?php echo $text?></textarea></code>
<br><br>
<?php
/*
* Lets see what we can do with SeoHelper
*/
$seo = new SeoHelper($text);
$keywords = $seo->getKeywords(12);
$desc = $seo->getDescription(150);
echo '<br /><b>Description:</b> '.$desc;
echo '<br /><b>Keywords:</b> '.$keywords;
?>
</body>
</html>