getPosition
boolean|integer public static \Bitrix\Main\Text\BinaryString::getPosition( $haystack, $needle, integer $offset );
Static method. Returns position, containing original search string relative to haystack string start, independent from offset. String position is counted from 0, not from 1. Returns false, when search string is not found. Executes safe operation in terms of multibyte character sets. Similar to PHP function strpos.
Parameters
Parameter | Description | Version |
---|---|---|
$haystack | Search string. | |
$needle | Original substring. If not a string, converted as integer and deemed as character code. | |
$offset | Offset. When this parameter is specified, starts the search from the indicated number of characters offset from start of string. Cannot be negative. |
Examples
© «Bitrix24», 2001-2024