removeHtmlTags() public method

Remove all HTML tags from a string.
public removeHtmlTags ( $string )
Exemplo n.º 1
0
function pageContent()
{
    $common = new common();
    global $posts, $pageLinks, $previewLength;
    ?>
            <div class="container">
                <h1>Blog Posts</h1>
                <hr />
<?php 
    foreach ($posts as $post) {
        ?>
                <h2><a href="post.php?title=<?php 
        echo urlencode($post['title']);
        ?>
"><?php 
        echo $post['title'];
        ?>
</a></h2>
                <p>Posted <strong><?php 
        echo date_format(date_create($post['date']), "F jS, Y");
        ?>
</strong> by <strong><?php 
        echo $post['author'];
        ?>
</strong>.</p>
                <div><?php 
        echo substr($common->removeHtmlTags($post['contents']), 0, $previewLength);
        ?>
</div>

<?php 
    }
    ?>
                <ul class="pagination">
<?php 
    $i = 1;
    while ($i <= $pageLinks) {
        ?>
                    <li><a href="?page=<?php 
        echo $i;
        ?>
"><?php 
        echo $i;
        ?>
</a></li>
<?php 
        $i++;
    }
    ?>
                </ul>
            </div>
<?php 
}