$mysqli = new mysqli('localhost','login','pass','db') or die(mysqli_error($mysqli));
$mysqli->set_charset("utf8mb4");
$result = $mysqli->query("SELECT * FROM `coininfo` WHERE coin = '$currentcoinurl' LIMIT 1");
foreach ($result as $row) {
$description = $row['description'];
$about = $row['about'];
$banner = $row['banner'];
$coinlogo = $row['coinlogo'];
$coinbrain = $row['coinbrain'];
$buycoinlink = $row['buycoinlink'];
$linked = $row['linkedaccount'];
$whitepaperlink = $row['whitepaperlink'];
$tag = $row['tag'];
$website = $row['website'];
$watchlists = $row['watchlists'];
}
function mask($text) {
$length = strlen($text);
$bytesHeader = [];
$bytesHeader[0] = 129; // 0x1 text frame (FIN + opcode)
if ($length <= 125) {
$bytesHeader[1] = $length;
} else if ($length >= 126 && $length <= 65535) {
$bytesHeader[1] = 126;
$bytesHeader[2] = ( $length >> 8 ) & 255;
$bytesHeader[3] = ( $length ) & 255;
} else {
$bytesHeader[1] = 127;
$bytesHeader[2] = ( $length >> 56 ) & 255;
$bytesHeader[3] = ( $length >> 48 ) & 255;
$bytesHeader[4] = ( $length >> 40 ) & 255;
$bytesHeader[5] = ( $length >> 32 ) & 255;
$bytesHeader[6] = ( $length >> 24 ) & 255;
$bytesHeader[7] = ( $length >> 16 ) & 255;
$bytesHeader[8] = ( $length >> 8 ) & 255;
$bytesHeader[9] = ( $length ) & 255;
}
$str = implode(array_map("chr", $bytesHeader)) . $text;
return $str;
}
function unmask($data) {
$data = array_map("ord", str_split($data));
$L = $data[1] AND 127;
if ($L == 126)
$iFM = 4;
else if ($L == 127)
$iFM = 10;
else
$iFM = 2;
$Masks = array_slice($data, $iFM, 4);
$unmaskedData = "";
for ($i = $iFM + 4, $j = 0; $i < count($data); $i++, $j++ ) {
$unmaskedData .= chr($data[$i] ^ $Masks[$j % 4]);
}
return $unmaskedData;
}