logo
Home XtGem- Templates- XtScript- bottom
Returns all of $haystack starting from and including the first occurrence of case-insensitive $needle to the end.
[...] = optional ... = your value
[var $... = ]call stristr $haystack=…;$needle=…[;$before_needle=…]
Returns the part of $haystack starting from and including the first occurrence of $needle to the end of $haystack
If $before_needle=1 the function returns the part of $haystack before the first occurrence of $needle (excluding $needle)
Show in textarea
<!--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-->
Show in textarea
Reload
Before needle
haystack = abcdefghijklm
needle = Hi
position = abcdefg
After needle
haystack = abcdefghijklm
needle = Hi
position = hijklm
Powered by XtGem
About us Contact Forum top