PHP Classes

Styled Texts: Change given text strings and format as HTML

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 112 All time: 9,623 This week: 673Up
Version License PHP version Categories
text_style 1.8GNU General Publi...5.3PHP 5, Text processing
Description 

Author

This class can change given text strings and format as HTML.

It takes a given text string and change certain strings to a given text.

The resulting text can be formatted as HTML using certain CSS classes to highlight the changed text strings.

Picture of Daniel Alan Guerrero Matamoros
  Performance   Level  
Name: Daniel Alan Guerrero ... <contact>
Classes: 7 packages by
Country: Mexico Mexico
Innovation award
Innovation award
Nominee: 1x

Example

<?php

require_once("text_change.php");

?>
<!DOCTYPE html>
<HTML>
<HEAD>

<TITLE>EXAPLE AND SYNTAX</TITLE>

<STYLE>

.my_css {
    background-color: red;
    color: black;
}

.n_t {
    color: blue;
}

</STYLE>

</HEAD>
<BODY>
<H1>LOL</H1>
<?php

#one time function
$t = new text_change(false, 0, true, "my_css");
$t->add_change("WARNING!");
$text = $t->print_changes("WARNING! UNEXPECTABLE VALUES IN THE CURRENT FILE");

echo
$text;

?>
<HR>
<?php

#multiples values
$m = new text_change(true, 5, true, "n_t");
$m->add_change("numeros");
$m->add_change("7");
$m->add_change("favoritos");
$m->add_change("12");
$texto = $m->print_changes("Los numeros 7 y 12 son mis favoritos entre todos los numeros que hay en el Universo.");

echo
$texto;

?>
</BODY>
</HTML>


  Files folder image Files (2)  
File Role Description
Plain text file text_change.php Class Text change class
Accessible without login Plain text file text_change_syntax.php Example Syntax and example of the class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadtext_style-2015-12-06.zip 1KB
Downloadtext_style-2015-12-06.tar.gz 1KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Emoji Convert Download .zip .tar.gz Extended class Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:112
This week:0
All time:9,623
This week:673Up