This file contains hidden or 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
| <?php | |
| function isEmail($email) { | |
| if((strlen($email) >= 6) and (substr_count($email, "@") === 1) and (substr($email, 0, 1) !== "@") and (substr($email, strlen($email) - 1, 1) !== "@")) { | |
| if((!strstr($email, "'")) and (!strstr($email, "\"")) and (!strstr($email, "\\")) and (!strstr($email, "\$")) and (!strstr($email, " "))) { | |
| if(substr_count($email, ".") >= 1) { | |
| $domain = substr(strrchr($email, "."), 1); | |
| if(strlen($domain) > 1 and strlen($domain) < 5 and (!strstr($domain, "@"))) { | |
| $prev = substr($email, 0, strlen($email) - strlen($domain) - 1); | |
| $last = substr($prev, strlen($prev) - 1, 1); |
This file contains hidden or 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
| <?php | |
| function isMobile($iphone = TRUE, $ipad = TRUE, $android = TRUE , $opera = TRUE, $blackberry = TRUE, $palm = TRUE, $windows = TRUE, $redirect = FALSE, $desktopRedirect = FALSE) { | |
| $mobile = FALSE; | |
| $userAgent = $_SERVER["HTTP_USER_AGENT"]; | |
| $accept = $_SERVER["HTTP_ACCEPT"]; | |
| $array = array( | |
| "1207" => "1207", "3gso" => "3gso", "4thp" => "4thp", "501i" => "501i", "502i" => "502i", "503i" => "503i", | |
| "504i" => "504i", "505i" => "505i", "506i" => "506i", "6310" => "6310", "6590" => "6590", "770s" => "770s", | |
| "802s" => "802s", "a wa" => "a wa", "acer" => "acer", "acs-" => "acs-", "airn" => "airn", "alav" => "alav", |
This file contains hidden or 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
| <?php | |
| function browser() { | |
| $browsers = array( | |
| "Opera" => "(Opera)", | |
| "Mozilla Firefox" => "((Firebird)|(Firefox))", | |
| "Galeon" => "(Galeon)", | |
| "Mozilla" => "(Gecko)", | |
| "MyIE" => "(MyIE)", | |
| "Lynx" => "(Lynx)", | |
| "Netscape" => "((Mozilla/4\.75)|(Netscape6)|(Mozilla/4\.08)|(Mozilla/4\.5)|(Mozilla/4\.6)|(Mozilla/4\.79))", |
This file contains hidden or 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
| <?php | |
| function cleanHTML($HTML) { | |
| $search = array ('@<script[^>]*?>.*?</script>@si', | |
| '@<[\/\!]*?[^<>]*?>@si', | |
| '@([\r\n])[\s]+@', | |
| '@&(quot|#34);@i', | |
| '@&(amp|#38);@i', | |
| '@&(lt|#60);@i', | |
| '@&(gt|#62);@i', | |
| '@&(nbsp|#160);@i', |
This file contains hidden or 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
| <?php | |
| function compress($string) { | |
| $string = str_replace(array("\r\n", "\r", "\n", "\t", " ", " ", " "), "", $string); | |
| return $string; | |
| } | |
| ?> |
This file contains hidden or 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
| <?php | |
| function isMultiArray($multiArray) { | |
| if(is_array($multiArray)) { | |
| foreach($multiArray as $array) { | |
| if(is_array($array)) { | |
| return TRUE; | |
| } | |
| } | |
| } | |
This file contains hidden or 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
| <?php | |
| function now($format, $hour = FALSE, $language = "Spanish") { | |
| if($hour) { | |
| $time = time() + 7200; | |
| $hours = (int) date("H", $time); | |
| $minutes = date("i", $time); | |
| $seconds = date("s", $time); | |
| if($hours > 12) { | |
| if($hours === 13) { |
This file contains hidden or 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
| <?php | |
| function getHour($date) { | |
| $date = explode(" ", $date); | |
| if(count($date) > 1) { | |
| $time = explode(":", $date[1]); | |
| } else { | |
| $time = explode(":", $date[0]); | |
| } | |
This file contains hidden or 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
| <?php | |
| function removeSpaces($text, $trim = FALSE) { | |
| $text = preg_replace("/\s+/", " ", $text); | |
| if($trim) { | |
| return trim($text); | |
| } | |
| return $text; | |
| } |
This file contains hidden or 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
| <?php | |
| function slug($string) { | |
| $characters = array("Á" => "A", "Ç" => "c", "É" => "e", "Í" => "i", "Ñ" => "n", "Ó" => "o", "Ú" => "u", | |
| "á" => "a", "ç" => "c", "é" => "e", "í" => "i", "ñ" => "n", "ó" => "o", "ú" => "u", | |
| "à" => "a", "è" => "e", "ì" => "i", "ò" => "o", "ù" => "u" | |
| ); | |
| $string = strtr($string, $characters); | |
| $string = strtolower(trim($string)); | |
| $string = preg_replace("/[^a-z0-9-]/", "-", $string); |