// Find URL Status Code // url https -- http denenmedi public static function httpCode($url) { $handle = curl_init($url); curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($handle); $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); return $httpCode; curl_close($handle); } public static function checkPort($host, $port) { try { $connection = fsockopen($host, $port, $errno, $errstr, 10); fclose($connection); return true; } catch (\Exception $e) { return false; } } public static function get_random_elements($array, $limit = 0) { shuffle($array); if ($limit > 0) { $array = array_splice($array, 0, $limit); } return $array; }