WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Find position of last occurrence of a string in a string

mb_strrpos

(PHP 4 >= 4.0.6, PHP 5)

mb_strrposFind position of last occurrence of a string in a string

Description

int mb_strrpos ( string $haystack , string $needle [, int $offset [, string $encoding ]] )

Performs a multibyte safe strrpos() operation based on the number of characters. needle position is counted from the beginning of haystack . First character's position is 0. Second character position is 1.

Parameters

haystack

The string being checked, for the last occurrence of needle

needle

The string to find in haystack .

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.
encoding

The encoding parameter is the character encoding. If it is omitted, the internal character encoding value will be used.

Return Values

Returns the numeric position of the last occurrence of needle in the haystack string. If needle is not found, it returns FALSE.

Changelog

Version Description
5.2.0 Added the optional parameter offset .

Notes

Note: The encoding parameter was moved from the third position to the fourth in PHP 5.2.0. For backward compatibility, encoding can be specified as the third parameter, but doing so is deprecated and will be removed in the future.

Note: The internal encoding or the character encoding specified by mb_regex_encoding() will be used as the character encoding for this function.

See Also


How to control the number of decimal places when outputting numbers.
Categories : PHP, Strings, Variables
A simple and fast calendar combining PHP and tables. Use this as a base for applications in which a calendar is needed.
Categories : Date Time, PHP, Complete Programs, Calendar
GetCombo Combo-BOX - Abstraction With function you can retrieve the combo-box structure with its data.
Categories : PHP, HTML and PHP



Creates a CAPTCHA image in PHP, which displays 5 numbers stored in a session.
Categories : PHP, GD image library, Form Processing, Security
How to get the number of seconds since 01/01/1970 (Timestamp) from MSSql?
Categories : MS SQL Server
Adding dashes to credit card numbers
Categories : Strings, Credit Cards, PHP
Permutations, Combinations and Factorials
Categories : PHP, PHP Classes, Math.
How to create a file with any number of UniqIDs (GUIDs)
Categories : PHP, Security
Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays.
Categories : Calendar, Date Time, PHP, Databases, MySQL
Adds dashes to a CC number. Was from this site, but now it works.
Categories : PHP, Credit Cards
This function returns a random string of a specified number of digits without leading zeros. For example, if three digits are specified, the function will return a random three-digit number from 100 to 999.
Categories : Algorithms, PHP
Numbers to words
Categories : PHP, PHP Classes
Embed Videos
Categories : PHP, HTML and PHP, Beginner Guides
Show Source with Line Numbers
Categories : PHP, Regexps, Filesystem