PHP Classes

File: views/href.html.php

Recommend this page to a friend!
  Classes of Morshed Alam   PHP Scrape Website Links   views/href.html.php   Download  
File: views/href.html.php
Role: Auxiliary script
Content type: text/plain
Description: To render To render hyper links
Class: PHP Scrape Website Links
Parse and extract links and images from Web pages
Author: By
Last change: Modify example page to show parsed title and meta tags
Date: 10 years ago
Size: 844 bytes
 

Contents

Class file image Download
<?php
if (count($links)) {
   
$count = count($links);

    echo
'<h4>Links: ' . $count . '</h4>';
    echo
'<div class="row">';

    echo
'<div class="span4">';
    echo
"<ul>";

   
$d = $count / 3;
    for (
$i = 0; $i < $d; $i++) {
        echo
'<li><a href="' . $links[$i][0] . '">' . $parser->truncateText($links[$i][1]) . '</a></li>';
    }
    echo
'</div>';

    echo
'<div class="span4">';
    echo
"<ul>";
    for (
$i = $d; $i < $d * 2; $i++) {
        echo
'<li><a href="' . $links[$i][0] . '">' . $parser->truncateText($links[$i][1]) . '</a></li>';
    }
    echo
'</div>';

    echo
'<div class="span4">';
    echo
"<ul>";
    for (
$k = $i; $k < $count; $k++) {
        echo
'<li><a href="' . $links[$k][0] . '">' . $parser->truncateText($links[$k][1]) . '</a></li>';
    }
    echo
"</ul>";
    echo
'</div>';
    echo
'</div>';
}