3.6. Function reference
3.6.24. position()
3.6.23. pluralize()
« Previous
3.6.25. range()
Next »

3.6.24. position()

Referenceint position(string $haystack, string $needle [, int $offset]])
Versionssince 2.0.5

Finds position of the first occurence of $needle in $haystack string. If the optional $offset is provided, the function searches from the specified offset. If the $needle is not found, the function returns NULL.

Sample use:

<a parse:href="$url">Click here</a>
<opt:if test="position($url, 'debug') !== null">
    <p>Warning: the link above switches on the debug mode.</p>
</opt:if>
3.6.24. position()
3.6. Function reference
« Previous
3.6.23. pluralize()
Next »
3.6.25. range()