2Hi.Biz
Trang chủ
|
TWIG
|
Xtscript
|
Templates
|
Xtgem
Functions Xtscript
AiChat.Wap.Sh
Strip_tags
Xóa HTML và PHP thẻ từ một chuỗi
[...] = optional ... = your value[var $... = ]call strip_tags $val=…[;$allowable_tags=...]
Code ví dụ:
<!--parser:xtscript-->
var $input = <span style="color:red"><u>FOOBAR</u></span>
var $output = call strip_tags $val=$input;$allowable_tags=<u>
print input = $input<br />
call htmlspecialchars $val=$input
print <hr />
print output = $output<br />
call htmlspecialchars $val=$output
<!--/parser:xtscript-->
<!--parser:xtscript--> var $input = <span style="color:red"><u>FOOBAR</u></span> var $output = call strip_tags $val=$input;$allowable_tags=<u> print input = $input<br /> call htmlspecialchars $val=$input print <hr /> print output = $output<br /> call htmlspecialchars $val=$output <!--/parser:xtscript-->
Code đã chạy:
input =
FOOBAR
<span style="color:red"><u>FOOBAR</u></span>
output =
FOOBAR
<u>FOOBAR</u>