- strpos: documentation ( source)
- trim: documentation ( source)
- strtolower: documentation ( source)
<?php
function TRIM_SEARCH_TABLE_UNIQ($column,$what)
{
$Find=0;
$e1=strpos('0'.trim(strtolower($column)),trim(strtolower($what)));
$e2=strpos('0'.trim(($what)),trim(strtolower($column)));
if(($e1>0)||($e2>0))
{
$Find=1;
return " YES ";
}
return " NO ";
}
//example 1 :
$column="smith";
$what="mike smith";
echo(TRIM_SEARCH_TABLE_UNIQ($column,$what));
//example 2 :
$column="mike smith";
$what="smith";
echo(TRIM_SEARCH_TABLE_UNIQ($column,$what));
//example 3 :
$column="andreas";
$what="smith";
echo(TRIM_SEARCH_TABLE_UNIQ($column,$what));
?>