This function is usefull for
accent insensitive regexp
searches into greek (iso8859-7) text:
(Select View -> Character Encoding -> Greek (iso8859-7)
at your browser to see the correct greek characters)
function gr_regexp($mystring){
$replacement=array(
array("?","?","?","?"),
array("?","?","?","?"),
array("?","?","?","?"),
array("?","?","?","?","?","?"),
array("?","?","?","?"),
array("?","?","?","?","?","?"),
array("?","?","?","?")
);
foreach($replacement as $group){
foreach($group as $character){
$exp="[";
foreach($group as $expcharacter){
$exp.=$expcharacter;
}
$exp.="]";
$trans[$character]=$exp;
}
}
$temp=explode(" ", $mystring);
for ($i=0;$i<sizeof($temp);$i++){
$temp[$i]=strtr($temp[$i],$trans);
$temp[$i]=addslashes($temp[$i]);
}
return implode(".*",$temp);
}
$match=gr_regexp("????????????????????? ??? ????????");
//The next query string can be sent to MySQL
through mysql_query()
$query=
"Select `column` from `table` where `column2` REGEXP
'".$match."'";