<?php
$text="<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>";
echo strip_tags($text);
echo "\n";
// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
?>
More Related Contents:
- PHP : string number manipulation
- How to set php class attribute?
- mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource
- Check if PHP session has already started
- Matching Unicode letter characters in PCRE/PHP
- Understanding the “post/redirect/get” pattern
- PDO Prepared Inserts multiple rows in single query
- How to properly URL encode a string in PHP?
- Constant FILTER_SANITIZE_STRING is deprecated
- mysql PDO how to bind LIKE
- Php mail: how to send html?
- How to check file types of uploaded files in PHP?
- Best way to defend against mysql injection and cross site scripting
- How we can add two date intervals in PHP
- What is a Front Controller and how is it implemented?
- Does mysql_real_escape_string() FULLY protect against SQL injection?
- Elegant way to get the count of months between two dates?
- Can I embed a .png image into an HTML page?
- Strip off URL parameter with PHP
- How to increment letters like numbers in PHP?
- Split string by delimiter, but not if it is escaped
- Magento upgrade takes too long and never completes
- Single and double quotes together as HTML attribute value?
- laravel TokenMismatchException in ajax request
- How to pass a PHP variable to Vue component instance in Laravel blade?
- Is APC compatible with PHP 5.4 or PHP 5.5?
- how to maintain session in cURL in php?
- Getting data from post array in CodeIgniter
- Fatal error: Call to undefined function mysql_connect() in C:\Apache\htdocs\test.php on line 2
- saving checkbox state on reload