true, CURLOPT_URL => $url, CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_SSL_VERIFYPEER => FALSE, CURLOPT_HEADER => 1, ); curl_setopt_array($ch, $opts); if ($uri['host'] != 'sh.st') curl_setopt($ch, CURLOPT_USERAGENT, $this->httph); if ($otherheader) curl_setopt($ch, CURLOPT_HTTPHEADER, $otherheader); if ($cookie) curl_setopt($ch, CURLOPT_COOKIE, $cookie); if ($postparam) { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postparam); } $data = curl_exec($ch); curl_close($ch); return ($data) ? $data : false; } /** * [decode_adfly adf.ly decode URL] * @param [string] $ysmm [adf.ly ysmm data] * @return [string] [Original URL] * Source by http://skizzerz.net/scripts/adfly.php */ public function decode_adfly( $ysmm ) { $left = ''; $right = ''; for ( $i = 0; $i < strlen( $ysmm ); $i++ ) { if ( $i % 2 == 0 ) { $left .= $ysmm[$i]; } else { $right = $ysmm[$i] . $right; } } return substr( base64_decode( $left . $right ), 2 ); } }