PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Strings> <Regex Funcţii
Last updated: Fri, 02 May 2008

view this page in

sql_regcase

(PHP 4, PHP 5)

sql_regcase — Make regular expression for case insensitive match

Descrierea

string sql_regcase ( string $string )

Creates a regular expression for a case insensitive match.

Parametri

string

The input string.

Valorile întroarse

Returns a valid regular expression which will match string , ignoring case. This expression is string with each alphabetic character converted to a bracket expression; this bracket expression contains that character's uppercase and lowercase form. Other characters remain unchanged.

Exemple

Example #1 sql_regcase() example

<?php
echo sql_regcase("Foo - bar.");
?>

Exemplul de mai sus va afişa:

[Ff][Oo][Oo] - [Bb][Aa][Rr].

This can be used to achieve case insensitive pattern matching in products which support only case sensitive regular expressions.



add a note add a note User Contributed Notes
sql_regcase
edge at gts dot smtn dot stavropol dot ru
25-Jun-2003 06:56
if you set right locale:

setlocale(LC_CTYPE,"ru_RU.KOI8-R");

print sql_regcase("Цffnung");

will output:
"[Цц][Ff][Ff][Nn][Uu][Nn][Gg]"

Strings> <Regex Funcţii
Last updated: Fri, 02 May 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites