0) && ($btc_usd_price > 0)) { return (float) $usd/$btc_usd_price; } return false; } function wapol_str($string) { if(preg_match('/[^a-z:\-0-9]/i', $string)) { return false; } else { return true; } } function sendReqtoURL($addr, $tokens) { $url = 'http://ranchimall.net/test/test.php'; $myvars = 'addr=' . $addr . '&tokens=' . $tokens; $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_POST, 1); curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt( $ch, CURLOPT_HEADER, 0); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec( $ch ); curl_close($ch); return (int) $response; } function is_email($email='') { $email = trim($email); if ($email != null) { if (filter_var($email, FILTER_VALIDATE_EMAIL)) { return true; } } return false; } function validate_decimal_place($num=0, $decimal_allowed=2) { $num = (float) $num; $decimal_places = strlen(substr(strrchr($num, "."), 1)); //if(($decimal_places > 0) && ($decimal_places <= $decimal_allowed)) { if($decimal_places <= $decimal_allowed) { return true; } return false; } function get_bcx_user_by_email($em='') { if (!is_email($em)) { return false; } try { $url = "https://bcx.ranchimall.net/bcx/api/user_by_email/".trim($em); $json = file_get_contents($url); $data = json_decode($json, TRUE); } catch(Exception $e) { $data = null; } return $data; }