Search
 
SCRIPT & CODE EXAMPLE
 

PHP

remove html tags from string php

<?php
	echo strip_tags("Hello <b>world!</b>");
Comment

remove html from string php

echo strip_tags("Hello <b>world!</b>");
Comment

php remove html 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 remove html tag

<?php
$str = "<h1>Hello WorldÆØÅ!</h1>";
# Remove all HTML tags and all characters with ASCII value > 127, from a string:
$newstr = filter_var($str, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);
echo $newstr;
# Result: Hello World!
Comment

PREVIOUS NEXT
Code Example
Php :: print query statement in laravel 
Php :: get featured image url 
Php :: long text in laravel migration 
Php :: laravel model tablename 
Php :: wp error log config 
Php :: protected table laravel 
Php :: php beautify json 
Php :: wordpress is_archive 
Php :: laravel check collection not empty 
Php :: laravel command to create symlink storage 
Php :: how to find php.ini 
Php :: get all routes laravel 
Php :: laravel migrate fresh and seed 
Php :: get all values inside session laravel 
Php :: content-type application/json php 
Php :: eloquent where between 
Php :: php unset session variable 
Php :: php make query string from array http_build_query 
Php :: get term thumbnail 
Php :: how to traverse characters in a string in a for loop in php 
Php :: file delete in laravel 
Php :: hide php extension in url 
Php :: php split string at first space 
Php :: get upload error codeigniter 
Php :: php program to validate phone number using regular expression 
Php :: laravel 9 route controller group 
Php :: How to display the fps in pygame 
Php :: uninstall php 8.0 ubuntu 
Php :: get php memory limit command line 
Php :: php mysql date 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =