PHP code example of maxodrom / yii2-seo
1. Go to this page and download the library: Download maxodrom/yii2-seo library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maxodrom / yii2-seo example snippets
use maxodrom\yii2seo\components\SeoText;
// instantiate new SeoText object
$seoText = new SeoText($model->textField);
// get total words in our text
$totalWords = $seoText->getWordsCount();
// get total characters count (including different spaces chars)
$totalCharacters = $seoText->getTotalCharactersCount();
// get only word's characters count
$wordCharacters = $seoText->getCharactersCount();
// get all spaces count
$totalSpaces = $seoText->getSpacesCount();