[Php 4, Php 5, Php 7, Php 8]
Dải_tags - Thẻ HTML và PHP thoát khỏi chuỗi từ một chuỗi — Strip HTML and PHP tags from a string
mariusz.tarnaski tại wp dot pl ¶ ¶
13 năm trước
Hi. I made a function that removes the HTML tags along with their contents:
Result for strip_tags[$text]:
Result for strip_tags_content[$text]:
Result for strip_tags_content[$text, '']:
Result for strip_tags_content[$text, '', TRUE];
I hope that someone is useful :]
Function:
Sample text:
$text = 'sample text with
sample text with tags
text with
sample text with
text with
BZPlan tại Web Dot de ¶ ¶
10 năm trước
a HTML code like this:
with
... the result is:
$str = 'color is bluesize is huge
material is wood';
notice: the words 'blue' and 'size' grow together :[
and line-breaks are still in new string $str
if you need a space between the words [and without line-break]
use my function:
... the result is:
$str = 'color is blue size is huge material is wood';
Function:
1
with
... the result is:
2
with
... the result is:
3
with
... the result is:
with
... the result is:
43 năm trước ¶
CEO tại Carpool2camp Dot org ¶
5
with
... the result is:
6
with
... the result is:
7
with
... the result is:
8
with
... the result is:
9
with
... the result is:
$str = 'color is bluesize is huge
0
material is wood';
$str = 'color is bluesize is huge
1
material is wood';
if[
2Trititaty ¶ ¶
Cesar tại Nixar Dot org ¶
$str = 'color is bluesize is huge
3
material is wood';
16 năm trước ¶
D Mo ¶
$str = 'color is bluesize is huge
4
material is wood';
$str = 'color is bluesize is huge
5
material is wood';
if[
24 năm trước ¶
7 năm trước
$str = 'color is bluesize is huge
7
material is wood';
$str = 'color is bluesize is huge
8
material is wood';
$str = 'color is bluesize is huge
9
material is wood';
notice: the words 'blue' and 'size' grow together :[
0
and line-breaks are still in new string $str
notice: the words 'blue' and 'size' grow together :[
1
and line-breaks are still in new string $str
if[
2Abe ¶ ¶
7 năm trước
notice: the words 'blue' and 'size' grow together :[
3
and line-breaks are still in new string $str
notice: the words 'blue' and 'size' grow together :[
4
and line-breaks are still in new string $str
notice: the words 'blue' and 'size' grow together :[
5
and line-breaks are still in new string $str
notice: the words 'blue' and 'size' grow together :[
6
and line-breaks are still in new string $str
notice: the words 'blue' and 'size' grow together :[
and line-breaks are still in new string $str
7