Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php strip tags

<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
//Test paragraph. Other text

// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
//<p>Test paragraph.</p> <a href="#fragment">Other text</a>
// as of PHP 7.4.0 the line above can be written as:
// echo strip_tags($text, ['p', 'a']);
?>

Comment

PHP strip_tags — Strip HTML and PHP tags from a string

<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "
";

// Allow <p> and <a>
echo strip_tags($text, '<p><a>');

// as of PHP 7.4.0 the line above can be written as:
// echo strip_tags($text, ['p', 'a']);
?>
Comment

strip html tag php

$text = '<a href="https://workforcenow.adp.com/mascsr/default/mdf/recruitment/recruitment.html?cid=ed2438b9-d7f4-45be-b3d8-8c924068c18a&amp;ccId=2036080543_6069&amp;jobId=329838&amp;source=CC2&amp;lang=en_US">https://workforcenow.adp.com/mascsr/default/mdf/recruitment/recruitment.html?cid=ed2438b9-d7f4-45be-b3d8-8c924068c18a&amp;ccId=2036080543_6069&amp;jobId=329838&amp;source=CC2&amp;lang=en_US</a>';
Comment

strip html tag php

$text = '<p>Test paraagraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
Comment

PREVIOUS NEXT
Code Example
Php :: php kommentar 
Php :: php aes 
Php :: php include multiple files at once 
Php :: wordpress query get results 
Php :: laravel filter get pagiination does not flter Appending To Pagination Links 
Php :: update laravel 7 to 8 
Php :: how to trim text php 
Php :: laravel belongstomany prevent duplicates attach 
Php :: how to manually remove cache in laravel 
Php :: laravel file uploads 
Php :: laravel get namespace 
Php :: php inline if condition date time 
Php :: creating default object from empty value laravel 
Php :: php my admin on linux 
Php :: wordpress change slug programmatically 
Php :: laravel 8 resource 
Php :: PDO Prepared Statement php 
Php :: php sort by key 
Php :: How do I log properly a Laravel Job 
Php :: laravel unique id 
Php :: finding second highest number in array 
Php :: time characters php 
Php :: git reset head 3 . how to back git init 
Php :: htaccess new date timestamp 
Php :: wordpress highlight text excerpt 
Php :: laravel route 
Php :: get 1 data from get laravel 
Php :: post is empty php api 
Php :: laravel get data from model to controller 
Php :: assocititive multi array compare php 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =