-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS: - replace link by url PHP: - add phpLIKE.php to use autocomplete whithout SQL
- Loading branch information
1 parent
5c40a26
commit f626185
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/*! | ||
Autocomplete a input Ajax wrapper for jQuery | ||
phpLIKE equivalent of SQL LIKE in PHP | ||
by Côme BURGUBURU | ||
Version 1.8.0 | ||
Full source at https://github.com/ComeBurguburu/autocomplete | ||
Copyright (c) 2015-2042 | ||
*/ | ||
/* | ||
return $input string without all accents | ||
*/ | ||
function insensitive_accent($input) { | ||
return preg_replace("/^'|[^A-Za-z0-9\s-]|'$/", '', iconv("utf-8", "ascii//TRANSLIT//IGNORE", $input)); | ||
} | ||
/* | ||
detect if $substring is contained in $string | ||
case insensitive | ||
accent insensitive | ||
return boolean | ||
*/ | ||
function LIKE($string, $substring){ | ||
return stripos(insensitive_accent($string),insensitive_accent($substring))!== false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters