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: 138 All time: 9,006 This week: 309Up
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: 57
All time rank: 136728 in Spain Spain
Week rank: 486 Up17 in Spain Spain Up
Innovation award
Innovation award
Nominee: 4x

 

Details
# 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.

<pre>
//Example
$query = new searchTagsInString();
$query->search_in = file_get_contents('https://www.egeon.es');
$query->tag = array('img', 'h2');
header('Content-type: application/json');
echo $query->ReturnData();

//result
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=\"https://www.egeon.es/sites/default/files/styles/servicios/public/Fotolia_90241958_XS.jpg?itok=w7iD2dxi\" 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"
</pre>

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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:138
This week:0
All time:9,006
This week:309Up

For more information send a message to info at phpclasses dot org.