2Hi.Biz
Trang chủ
|
TWIG
|
Xtscript
|
Templates
|
Xtgem
Functions Xtscript
AiChat.Wap.Sh
strstr
Trả về tất cả các
$haystack
kể từ và bao gồm cả sự xuất hiện đầu tiên của
$needle
đến cùng.
[...] = optional ... = your value[var $... = ]call strstr $haystack=…;$needle=…[;$before_needle=…]
Code ví dụ:
<!--parser:xtscript-->
var $haystack = abcdefghijklm
var $needle = g
var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=1 ;
print haystack = $haystack<br />
print needle = $needle<br />
print position = $position<hr />
var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=0 ;
print haystack = $haystack<br />
print needle = $needle<br />
print position = $position
<!--/parser:xtscript-->
<!--parser:xtscript--> var $haystack = abcdefghijklm var $needle = g var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=1 ; print haystack = $haystack<br /> print needle = $needle<br /> print position = $position<hr /> var $position = call strstr $haystack=$haystack; $needle=$needle; $before_needle=0 ; print haystack = $haystack<br /> print needle = $needle<br /> print position = $position <!--/parser:xtscript-->
Code đã chạy:
haystack = abcdefghijklm
needle = g
position = abcdef
haystack = abcdefghijklm
needle = g
position = ghijklm