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
Finds first occurrence of a string within another

mb_strstr

(PHP 5 >= 5.2.0)

mb_strstrFinds first occurrence of a string within another

Description

string mb_strstr ( string $haystack , string $needle [, bool $part [, string $encoding ]] )

mb_strstr() finds the first occurrence of needle in haystack and returns the portion of haystack . If needle is not found, it returns FALSE.

Parameters

haystack

The string from which to get the first occurrence of needle

needle

The string to find in haystack

part

Determines which portion of haystack this function returns. If set to TRUE, it returns all of haystack from the beginning to the first occurrence of needle . If set to FALSE, it returns all of haystack from the first occurrence of needle to the end, Default value is FALSE.

encoding

Character encoding name to use. If it is omitted, internal character encoding is used.

Return Values

Returns the portion of haystack , or FALSE if needle is not found.

See Also

  • stristr() - Case-insensitive strstr
  • strstr() - Find first occurrence of a string
  • mb_stristr() - Finds first occurrence of a string within another, case insensitive


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



Adds dashes to a CC number. Was from this site, but now it works.
Categories : PHP, Credit Cards
Permutations, Combinations and Factorials
Categories : PHP, PHP Classes, Math.
A very useful function to display text on specified number of characters.
Categories : PHP, Strings
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
Show Source with Line Numbers
Categories : PHP, Regexps, Filesystem
How to limit the number of records returned by a query in PostgreSQL
Categories : Databases, PostgreSQL
complete simply working javascript password generator file. Use letter, vowels, consonants (uppercase and lowercase) arrays to create a really random and secure password. improved security using time functions to initialize random number generator.
Categories : Java Script, HTML, Security, Authentication, Strings
How to find the error meaning of an Informix error number.
Categories : Databases, Informix, Debugging
Function to convert Arabic numbers into Roman Numerals
Categories : Algorithms, PHP, Date Time
How to format numbers.
Categories : PHP