logo
Home XtGem- Templates- XtScript- bottom
XtGemmanual

XtScript functions

stripos

Find the position of the first occurrence of a case-insensitive substring in a string

Syntax

[var $... = ]call stripos $haystack=…;$needle=…[;$offset=…][...] optional · ... your value

Notes

negative $offset values do not work

Example

<!--parser:xtscript-->
var $haystack = abefcdefghijklm
var $needle = EF
var $offset = 4
var $position = call stripos $haystack=$haystack; $needle=$needle; $offset=$offset ;
print haystack = $haystack<br />
print needle = $needle<br />
print offset = $offset<br />
print position = $position
<!--/parser:xtscript-->

Copy as text

Output reload

haystack = abefcdefghijklm
needle = EF
offset = 4
position = 6

Related

stristr strpos strrchr strripos strrpos strstr substr

XtGem manual · all sections

Powered by XtGem
About us Contact Forum top