freelance programmers outsource from india freelance programmers  chennai india programmers freelance programmers  freelance php coder freelance outsource scripts freelance programmers programming complicated perl patterns freelance programmers php module installation freelance programmers
freelance programmers  outsource from india freelance programmers  perl installation and configuration freelance programmers  php installation linux system freelance programmers administration US$15,US$19,US$11,US$10 cheap programmer
india outsource outsource india chennai india programmers php perl mysql freelance freelance programmer
SHOWCASE of php and perl scripts CONTACT US for php custom perl scripts
HOME
 

strrpos

(PHP 3, PHP 4, PHP 5)

strrpos --  Find position of last occurrence of a char in a string

Description

int strrpos ( string haystack, string needle [, int offset] )

Returns the numeric position of the last occurrence of needle in the haystack string. Note that the needle in this case can only be a single character in PHP 4. If a string is passed as the needle, then only the first character of that string will be used.

If needle is not found, returns FALSE.

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

// in PHP 4.0b3 and newer:
$pos = strrpos($mystring, "b");
if (
$pos === false) { // note: three equal signs
    // not found...
}

// in versions older than 4.0b3:
$pos = strrpos($mystring, "b");
if (
is_bool($pos) && !$pos) {
    
// not found...
}
?>

If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.

Note: As of PHP 5.0.0 offset may be specified to begin searching an arbitrary number of characters into the string. Negative values will stop searching at an arbitrary point prior to the end of the string.

Note: The needle may be a string of more than one character as of PHP 5.0.0.

See also strpos(), strripos(), strrchr(), substr(), stristr(), and strstr().

Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/. Please see full copyright text at http://www.php.net/manual/en/copyright.php Original version of the above documentation is available at http://www.php.net/manual/en/



  1. Please click on Story and Event management using php mysql
  2. Please Also click on our Web developers Showcase



Web design and Programming Copyright @ Chrisranjana.com 1999-2007. Website designed and Webdevelopers and Website programmed by Web developers and Software programmers. We do excellent software development in asp and .net c# csharp also