strip_tags
strip_tags — Strip HTML and PHP tags from a string.Description
strip_tags( string $string,This function tries to return a string with all NULL bytes, HTML and PHP tags stripped from a given string.
array|string|null $allowed_tags = null ): string
Note: HTML comments and PHP tags are also stripped. This is hardcoded and can not be changed with allowed_tags.
Parameters
string
The input string.
allowed_tags
You can use the optional second parameter to specify tags which should not be stripped. These are either given as string, or as of PHP 7.4.0, as array. Refer to the example below regarding the format of this parameter.
Return Values
Returns the stripped string.More information about strip_tags on official PHP documentation site
strip_tags - Popular snippets
- PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
last run:
2024-02-23 11:20:13
2
- PHP 8.1 / MySQL 5.7 array_pop strtok substr strlen strip_tags
last run:
2023-09-05 20:10:46
2
- PHP 8.1 / MySQL 5.7 curl_init curl_setopt curl_exec strip_tags
last run:
2022-07-25 08:06:39
2
- PHP 8.0 / MySQL 5.7 strpos substr strip_tags file_get_contents var_dump in_array
last run:
2021-06-25 18:27:46
2
- PHP 8.0 / MySQL 5.7 strip_tags
last run:
2021-04-29 13:19:38
2
- PHP 8.0 / MySQL 5.7 date htmlspecialchars strip_tags printf
last run:
2022-03-12 20:59:02
2
- PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
last run:
2024-02-23 16:05:16
1
- PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
last run:
2024-02-23 16:04:40
1
- PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
last run:
2024-02-23 16:04:09
1
- PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
last run:
2024-02-23 16:03:39
1
strip_tags - New snippets
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 16:05:16
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 16:04:40
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 16:04:09
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 16:03:39
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 16:02:58
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 11:23:00
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 11:22:04
1
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 11:20:07
2
-
PHP 8.1 / MySQL 5.7 htmlspecialchars strip_tags
added at:
2024-02-23 01:38:26
1
-
PHP 5.6 / PostgreSQL 12 preg_replace strtolower strip_tags preg_split count array_slice in_array end implode array_filter arsort array_merge
added at:
2023-11-04 20:27:38
1