PHP 8.5.0 Alpha 4 available for testing

Voting

: min(five, five)?
(Example: nine)

The Note You're Voting On

ktogias at math dot upatras dot gr
20 years ago
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."'";

<< Back to user notes page

To Top