Basic thing, strpos and strrpos are two php functions which are used to find the position of first and/or last occurrence in a string – word (usefull for example when you want to build a function to get file extension). I hear you saying enough talking, let me see the available examples :
<?php //get first occurrence $string = "this string"; $find = "i"; print strpos($string,$find);//should print 2 print strrpos($string,$find); //should print 8 ?>
Pingback: XkiD | PHP Tutorial : Strpos and Strrpos | blog.xkid.ro