2Hi.Biz
Trang chủ
|
TWIG
|
Xtscript
|
Templates
|
Xtgem
Functions Xtscript
AiChat.Wap.Sh
stristr
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 stristr $haystack=…;$needle=…[;$before_needle=…]
Code ví dụ:
<!--parser:xtscript-->
var $haystack = abcdefghijklm
var $needle = Hi
print Before needle<br />
var $position = call stristr $haystack=$haystack; $needle=$needle; $before_needle=1
print haystack = $haystack<br />
print needle = $needle<br />
print position = $position<hr />
print After needle<br />
var $position = call stristr $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 = Hi print Before needle<br /> var $position = call stristr $haystack=$haystack; $needle=$needle; $before_needle=1 print haystack = $haystack<br /> print needle = $needle<br /> print position = $position<hr /> print After needle<br /> var $position = call stristr $haystack=$haystack; $needle=$needle; $before_needle=0 print haystack = $haystack<br /> print needle = $needle<br /> print position = $position <!--/parser:xtscript-->
Code đã chạy:
Before needle
haystack = abcdefghijklm
needle = Hi
position = abcdefg
After needle
haystack = abcdefghijklm
needle = Hi
position = hijklm