<?php $pos = strrpos($mystring, "b"); if ($pos === false) { // note: three equal signs // not found... } ?>