$haystack
, string $needle
[, int $offset
= 0
] )
Find the numeric position of the last occurrence of
needle
in the haystack
string.
Anonymous user / 18.119.132.236 Log In Register |
?
Wallet:
3.00
Daily Credits:
1.20 / 1.20
|
This is your credit balance. Even if you are an anonymous user, you are given some credits to spend. Every IP address has its own account and it is provided with free credits that can be used to pay for Online Domain Tools services. Moreover, credit balance is reset every day. This is why we call them Daily Credits. Registered users have higher Daily Credits amounts and can even increase them by purchasing subscriptions.
Besides Daily Credits, all accounts, including IP address accounts of anonymous users, have their credit Wallet. Wallet credits are not reset on a daily basis, but they are only spent when a user has not enough Daily Credits. Registered users can buy credits to their wallets. All IP address accounts are created with an initial Wallet balance of 3.00. Once IP address account spends credits from its Wallet, it can not be charged again. This should allow new users to try most of Online Domain Tools services without registration.
$haystack
, string $needle
[, int $offset
= 0
] )
Find the numeric position of the last occurrence of
needle
in the haystack
string.
The string to search in.
If needle
is not a string, it is converted
to an integer and applied as the ordinal value of a character.
If specified, search will start this number of characters counted from the beginning of the string. If the value is negative, search will instead start from that many characters from the end of the string, searching backwards.
Returns the position where the needle exists relative to the beginnning of
the haystack
string (independent of search direction
or offset).
Also note that string positions start at 0, and not 1.
Example #1 Checking if a needle is in the haystack
It is easy to mistake the return values for "character found at position 0" and "character not found". Here's how to detect the difference:
<?php
$pos = strrpos($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}
?>
Version | Description |
---|---|
5.0.0 |
The needle may now be a string of more than one
character.
|
5.0.0 |
The offset parameter was introduced.
|