3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs echo "not found..."; } $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs echo "not found..."; } $foo = "0123456789a123456789b123456789c"; var_dump(strrpos($foo, '7', -5)); // Starts looking backwards five positions // from the end. Result: int(17) var_dump(strrpos($foo, '7', 20)); // Starts searching 20 positions into the // string. Result: int(27) var_dump(strrpos($foo, '7', 28)); // Result: bool(false)

preferences:
40.04 ms | 402 KiB | 5 Q