PHP Classes

Search Tags in String: Extract given tags from a HTML document

Recommend this page to a friend!
  Info   View files Documentation   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 143 All time: 9,097 This week: 163Up
Version License PHP version Categories
search-tags-in-strin 1.0.1Artistic License5HTML, PHP 5
Description Author

This class can extract given tags from a HTML document.

It takes the HTML of a document and searches for given tags.

The class can return an array encoded as JSON with HTML for the found tags including the HTML inside them.

Picture of Juan Chaves
  Performance   Level  
Name: Juan Chaves <contact>
Classes: 13 packages by
Country: Spain Spain
Age: 59
All time rank: 134729 in Spain Spain
Week rank: 285 Up15 in Spain Spain Up
Innovation award
Innovation award
Nominee: 4x

# search_Tags_In_String
This class searches in the document or in a url the repeats of the chosen tag and displays it in json format.

$query = new searchTagsInString();
$query->search_in = file_get_contents('');
$query->tag = array('img', 'h2');
header('Content-type: application/json');
echo $query->ReturnData();

img :	
	0 : "&lt;img src=\"/sites/all/themes/anchor/img/twitter-top25.png\" width=\"135\" height=\"37\" border=\"0\" alt=\"Top 25 Language Twitterers 2014\">"
	1 : "&lt;img src=\"\" width=\"820\" height=\"193\" alt=\"hacemos en egeon\" title=\"hacemos en egeon\">"
	2 : "&lt;img alt=\"Adquiera un de nombre de dominio\" src=\"/sites/default/files/dominios_hosting.png\" title=\"Adquiera un de nombre de dominio\">"
	3 : "&lt;img alt=\"Adquiera alojamiento web\" src=\"/sites/default/files/hosting2.png\" title=\"Adquiera alojamiento web\">"
	4 : "&lt;img alt=\"Adquiera certificados SSL\" src=\"/sites/default/files/certificados_hosting.png\" title=\"Adquiera certificados SSL\">"
	5 : "&lt;img alt=\"Adquiera correo electrónico para su empresa\" src=\"/sites/default/files/emails-hosting.png\" title=\"Adquiera correo electrónico para su empresa\">"
	6 : "&lt;img alt=\"demo correo electrónico para su empresa\" src=\"/sites/default/files/demo.png\" title=\"demo correo electrónico para su empresa\">"
	7 : "&lt;img src=\"/sites/all/themes/anchor/img/e-redonda15x15b.png\" alt=\"imagen e redonda\">"
h2 : 
	0 : "&lt;h2 class=\"mega\"> eGeon&lt;/h2>"
	1 : "&lt;h2 class=\"element-invisible\">Formulario de búsqueda&lt;/h2>\n"
	2 : "&lt;h2>Menú principal&lt;/h2>\n"
	3 : "&lt;h2>Tags&lt;/h2>\n"
	4 : "&lt;h2>Últimos tweets&lt;/h2>\n"
	5 : "&lt;h2>Dónde estamos&lt;/h2>\n"
	6 : "&lt;h2>Redes sociales&lt;/h2>\n"

  Files folder image Files  
File Role Description
Accessible without login HTML file Doc. Documentation
Plain text file search_tags_in_string.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,097
This week:163Up