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 first occurrence of string in a string

mb_strpos

(PHP 4 >= 4.0.6, PHP 5)

mb_strposFind position of first occurrence of string in a string

Description

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

Finds position of the first occurrence of a string in a string.

Performs a multi-byte safe strpos() operation based on number of characters. The first character's position is 0, the second character position is 1, and so on.

Parameters

haystack

The string being checked.

needle

The position counted from the beginning of haystack .

offset

The search offset. If it is not specified, 0 is used.

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 first occurrence of needle in the haystack string. If needle is not found, it returns FALSE.

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
Scramble Eggs - php class to scramble/encode
Categories : PHP, PHP Classes, Security, Encryption



GetCombo Combo-BOX - Abstraction With function you can retrieve the combo-box structure with its data.
Categories : PHP, HTML and PHP
Dynamic thumbnails using the GD image library
Categories : PHP, GD image library, Graphics
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
Prime number finder (Sieve of Erastothenes)
Categories : PHP, Algorithms, Math.
Adding dashes to credit card numbers
Categories : Strings, Credit Cards, PHP
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
Embed Videos
Categories : PHP, HTML and PHP, Beginner Guides
Reduce the number of processors on a NT 4.0 system thru BOOT.INI
Categories : WinNT