What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.



eregi — Performs a non-case-sensitive POSIX regular expression match against the specified string.


string eregi(pattern, subject[, matches]);
string pattern: Regex pattern to match
string subject: String to search using the pattern
array matches (optional): Array in which to store the search results


FALSE if no match is found; otherwise, the length of the full match if the matches parameter is specified or 1 if it's not specified


This function works like ereg() except that it ignores the case when matching alphabetic characters. See ereg() for a description of its parameters and usage.


eregi() handles case properly for ISO-8859-1 8-bit alphabetic characters such as ƒ.

See also

See also ereg() , preg_match() , preg_match_all()


Example 1123. Simple string match (non-case-sensitive version)

$look_for = "Quick";
$string = "The quick brown fox jumped over the lazy dog";
if (!eregi($look_for, $string)) {
   echo "Didn't find $look_for. Not there, even lowercase.\n";
else {
   echo "Found $look_for.\n";

PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at The authors of this book have elected not to choose any options under the OPL. This online book was obtained from and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.