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 makeLink($string){ | |
| return strtolower(preg_replace('/\s+/', '_', $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
| search_string_and_highlight(str,searchData){ | |
| if(str == null || /^\s*$/.test(str) === 0 ){ | |
| return string | |
| } | |
| let string = str.toString() | |
| let checkString = string.toLowerCase() | |
| let span = '<span class="text-primary">' | |
| let endSpan = '</span>' | |
| if(searchData !== null){ | |
| let search = searchData |
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 | |
| if(!function_exists('getRequestDomain')){ | |
| function getRequestDomain(){ | |
| if(isset($_SERVER['HTTP_ORIGIN'])){ | |
| return $_SERVER['HTTP_ORIGIN']; | |
| }elseif(isset($_SERVER['HTTP_REFERER'])){ | |
| return substr($_SERVER['HTTP_REFERER'], 0, -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
| isset = (arrayKey,array) => array.includes(arrayKey); |
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 | |
| if(!function_exists('getDomainName')){ | |
| function getDomainName(){ | |
| $http = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://' ; | |
| $pageLink = isset($_GET['page']) ? str_replace('&page=', NULL,str_replace('?page=', NULL, substr_replace($_SERVER['REQUEST_URI'],NULL,-strlen($_GET['page'])))) : $_SERVER["REQUEST_URI"]; | |
| return $http . $_SERVER['HTTP_HOST'] . $pageLink; | |
| } | |
| } |
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 | |
| if(!function_exists('jsonResponse')){ | |
| function jsonResponse(array $data,int $code=200){ | |
| header('Content-type:application/json'); | |
| http_response_code($code); | |
| echo json_encode($data); | |
| 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 showPromotionPricePercentage( $price , $promotionPrice ){ | |
| return round( ( $price - $promotionPrice )*100/$price ); | |
| } |
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 regexForNameValidation(){ | |
| return '^[A-Za-z_ ]+$'; | |
| } |
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 | |
| class UserDevice | |
| { | |
| public const AVAILABLE_DEVICES = [ | |
| 'mobile' => ['iPhone','Android'], | |
| 'computer' => ['Windows','Linux x86_64','Macintosh'] | |
| ]; | |
| public static function getUserAgent(){ |
NewerOlder