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 :: cache for php website 
Php :: route parameter type laravel 
Php :: phpspreadsheet 
Php :: Merging Two Laravel Collections keeping the original keys 
Php :: contractors php 
Php :: string to lowercase accentuation hyphenated 
Php :: laravel htaccess to remove public from url 
Php :: laravel dingo api response 
Php :: php artisan vendor:publish --provider="SpatieActivitylogActivitylogServiceProvider" --tag="activitylog-migrations" 
Php :: woocommerce_rest_cannot_view 
Php :: hide category menu from custom post type 
Php :: laravel collection zip 
Php :: Wordpress even odd post count 
Php :: aravel cache store does not support tagging 
Php :: laravel collection tap 
Php :: echo two variables same line php 
Php :: fpdf tutorial php mysql 
Php :: phpexcel set data type 
Php :: how to set tinyint default 0 laravel migration 
Php :: How to automail in php 
Php :: Declaration of AppExportsTarefasExport::headings() must be compatible with MaatwebsiteExcelConcernsWithHeadings::headings(): array 
Php :: implode remove empty php 
Php :: laravel collection makeVisible 
Php :: whats is typecasting in php 
Php :: how to put external file in laravel listener class 
Php :: Yii2 hasMany relation additional condition 
Php :: array issue in php 
Php :: First-class Callable Syntax - PHP 8.1 
Php :: How to remove repetitive values from foreach loop in php laravel 
Php :: delete file in s3 laravel 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =