46 個非常有用的 PHP 代碼片段(一)

編譯地址:46 USEFUL PHP CODE SNIPPETS THAT CAN HELP YOU WITH YOUR PHP PROJECTS
原文地址:http://www.oschina.net/question/2012764_246023

PHP.jpg

在編寫代碼的時候有個神奇的工具總是好的劲够!下面這里收集了 40+ PHP 代碼片段,可以幫助你開發(fā) PHP 項目。今天分享前20個PHP代碼片段,這些片段對于 PHP 初學(xué)者也非常有幫助,非常容易學(xué)習(xí)窄赋,讓我們開始學(xué)習(xí)吧!
1.發(fā)送 SMS
--
在開發(fā) Web 或者移動應(yīng)用的時候,經(jīng)常會遇到需要發(fā)送 SMS 給用戶撒妈,或者因為登錄原因,或者是為了發(fā)送信息排监。下面的 PHP 代碼就實現(xiàn)了發(fā)送 SMS 的功能狰右。

為了使用任何的語言發(fā)送 SMS,需要一個 SMS gateway舆床。大部分的 SMS 會提供一個 API棋蚌,這里是使用MSG91 作為 SMS gateway。

function send_sms($mobile,$msg)
{
$authKey = "XXXXXXXXXXX";
date_default_timezone_set("Asia/Kolkata");
$date = strftime("%Y-%m-%d %H:%M:%S");
//Multiple mobiles numbers separated by comma
$mobileNumber = $mobile;

//Sender ID,While using route4 sender id should be 6 characters long.
$senderId = "IKOONK";

//Your message to send, Add URL encoding here.
$message = urlencode($msg);

//Define route 
$route = "template";
//Prepare you post parameters
$postData = array(
    'authkey' => $authKey,
    'mobiles' => $mobileNumber,
    'message' => $message,
    'sender' => $senderId,
    'route' => $route
);

//API URL
$url="https://control.msg91.com/sendhttp.php";

// init the resource
$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => $postData
    //,CURLOPT_FOLLOWLOCATION => true
));

//Ignore SSL certificate verification
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

//get response
$output = curl_exec($ch);
//Print error if any
if(curl_errno($ch))
{
    echo 'error:' . curl_error($ch);
}

curl_close($ch);
}

其中“$authKey = "XXXXXXXXXXX";”需要你輸入你的密碼,“$senderId = "IKOONK";”需要你輸入你的 SenderID附鸽。當(dāng)輸入移動號碼的時候需要指定國家代碼 (比如脱拼,美國是 1,印度是 91 )坷备。

語法:

<?php
$message = "Hello World";
$mobile = "918112998787";
send_sms($mobile,$message);
?>

2.使用 mandrill 發(fā)送郵件

Mandrill 是一款強大的 SMTP 提供器熄浓。開發(fā)者傾向于使用一個第三方 SMTP provider 來獲取更好的收件交付。

下面的函數(shù)中省撑,你需要把 “Mandrill.php” 放在同一個文件夾赌蔑,作為 PHP 文件,這樣就可以使用TA來發(fā)送郵件竟秫。

function send_email($to_email,$subject,$message1)
{
require_once 'Mandrill.php';
$apikey = 'XXXXXXXXXX'; //specify your api key here
$mandrill = new Mandrill($apikey);

$message = new stdClass();
$message->html = $message1;
$message->text = $message1;
$message->subject = $subject;
$message->from_email = "blog@koonk.com";//Sender Email
$message->from_name  = "KOONK";//Sender Name
$message->to = array(array("email" => $to_email));
$message->track_opens = true;

$response = $mandrill->messages->send($message);
}

“$apikey = 'XXXXXXXXXX'; //specify your api key here”這里需要你指定你的 API 密鑰(從 Mandrill 賬戶中獲得)娃惯。

語法:

<?php
$to = "abc@example.com";
$subject = "This is a test email";
$message = "Hello World!";
send_email($to,$subject,$message);
?>

為了達(dá)到最好的效果,最好按照 Mandrill 的教程去配置 DNS肥败。

3.PHP 函數(shù):阻止 SQL 注入

SQL 注入或者 SQLi 常見的攻擊網(wǎng)站的手段趾浅,使用下面的代碼可以幫助你防止這些工具。

function clean($input)
{
    if (is_array($input))
    {
        foreach ($input as $key => $val)
         {
            $output[$key] = clean($val);
            // $output[$key] = $this->clean($val);
        }
    }
    else
    {
        $output = (string) $input;
        // if magic quotes is on then use strip slashes
        if (get_magic_quotes_gpc()) 
        {
            $output = stripslashes($output);
        }
        // $output = strip_tags($output);
        $output = htmlentities($output, ENT_QUOTES, 'UTF-8');
    }
// return the clean text
    return $output;
}

語法:

<?php
$text = "<script>alert(1)</script>";
$text = clean($text);
echo $text;
?>

4.檢測用戶位置

使用下面的函數(shù)馒稍,可以檢測用戶是在哪個城市訪問你的網(wǎng)站皿哨。

function detect_city($ip) {

        $default = 'UNKNOWN';

        $curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)';

        $url = 'http://ipinfodb.com/ip_locator.php?ip=' . urlencode($ip);
        $ch = curl_init();

        $curl_opt = array(
            CURLOPT_FOLLOWLOCATION  => 1,
            CURLOPT_HEADER      => 0,
            CURLOPT_RETURNTRANSFER  => 1,
            CURLOPT_USERAGENT   => $curlopt_useragent,
            CURLOPT_URL       => $url,
            CURLOPT_TIMEOUT         => 1,
            CURLOPT_REFERER         => 'http://' . $_SERVER['HTTP_HOST'],
        );

        curl_setopt_array($ch, $curl_opt);

        $content = curl_exec($ch);

        if (!is_null($curl_info)) {
            $curl_info = curl_getinfo($ch);
        }

        curl_close($ch);

        if ( preg_match('{<li>City : ([^<]*)</li>}i', $content, $regs) )  {
            $city = $regs[1];
        }
        if ( preg_match('{<li>State/Province : ([^<]*)</li>}i', $content, $regs) )  {
            $state = $regs[1];
        }

        if( $city!='' && $state!='' ){
          $location = $city . ', ' . $state;
          return $location;
        }else{
          return $default; 
        }

    }

語法:

<?php
$ip = $_SERVER['REMOTE_ADDR'];
$city = detect_city($ip);
echo $city;
?>

5.獲取 Web 頁面的源代碼

使用下面的函數(shù),可以獲取任意 Web 頁面的 HTML 代碼纽谒。

function display_sourcecode($url)
{
$lines = file($url);
$output = "";
foreach ($lines as $line_num => $line) { 
    // loop thru each line and prepend line numbers
    $output.= "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br>\n";
}
}

語法:

<?php
$url = "http://blog.koonk.com";
$source = display_sourcecode($url);
echo $source;
?>

6.計算喜歡你的 Facebook 頁面的用戶

function fb_fan_count($facebook_name)
{
    $data = json_decode(file_get_contents("https://graph.facebook.com/".$facebook_name));
    $likes = $data->likes;
    return $likes;
}

語法:

<?php
$page = "koonktechnologies";
$count = fb_fan_count($page);
echo $count;
?>

7.確定任意圖片的主導(dǎo)顏色

function dominant_color($image)
{
$i = imagecreatefromjpeg($image);
for ($x=0;$x<imagesx($i);$x++) {
    for ($y=0;$y<imagesy($i);$y++) {
        $rgb = imagecolorat($i,$x,$y);
        $r   = ($rgb >> 16) & 0xFF;
        $g   = ($rgb >>  & 0xFF;
        $b   = $rgb & 0xFF;
        $rTotal += $r;
        $gTotal += $g;
        $bTotal += $b;
        $total++;
    }
}
$rAverage = round($rTotal/$total);
$gAverage = round($gTotal/$total);
$bAverage = round($bTotal/$total);
}

8.whois 查詢

使用下面的函數(shù)可以獲取任何域名用戶的完整細(xì)節(jié)证膨。

function whois_query($domain) {

    // fix the domain name:
    $domain = strtolower(trim($domain));
    $domain = preg_replace('/^http:\/\//i', '', $domain);
    $domain = preg_replace('/^www\./i', '', $domain);
    $domain = explode('/', $domain);
    $domain = trim($domain[0]);

    // split the TLD from domain name
    $_domain = explode('.', $domain);
    $lst = count($_domain)-1;
    $ext = $_domain[$lst];

    // You find resources and lists 
    // like these on wikipedia: 
    //
    // http://de.wikipedia.org/wiki/Whois
    //
    $servers = array(
        "biz" => "whois.neulevel.biz",
        "com" => "whois.internic.net",
        "us" => "whois.nic.us",
        "coop" => "whois.nic.coop",
        "info" => "whois.nic.info",
        "name" => "whois.nic.name",
        "net" => "whois.internic.net",
        "gov" => "whois.nic.gov",
        "edu" => "whois.internic.net",
        "mil" => "rs.internic.net",
        "int" => "whois.iana.org",
        "ac" => "whois.nic.ac",
        "ae" => "whois.uaenic.ae",
        "at" => "whois.ripe.net",
        "au" => "whois.aunic.net",
        "be" => "whois.dns.be",
        "bg" => "whois.ripe.net",
        "br" => "whois.registro.br",
        "bz" => "whois.belizenic.bz",
        "ca" => "whois.cira.ca",
        "cc" => "whois.nic.cc",
        "ch" => "whois.nic.ch",
        "cl" => "whois.nic.cl",
        "cn" => "whois.cnnic.net.cn",
        "cz" => "whois.nic.cz",
        "de" => "whois.nic.de",
        "fr" => "whois.nic.fr",
        "hu" => "whois.nic.hu",
        "ie" => "whois.domainregistry.ie",
        "il" => "whois.isoc.org.il",
        "in" => "whois.ncst.ernet.in",
        "ir" => "whois.nic.ir",
        "mc" => "whois.ripe.net",
        "to" => "whois.tonic.to",
        "tv" => "whois.tv",
        "ru" => "whois.ripn.net",
        "org" => "whois.pir.org",
        "aero" => "whois.information.aero",
        "nl" => "whois.domain-registry.nl"
    );

    if (!isset($servers[$ext])){
        die('Error: No matching nic server found!');
    }

    $nic_server = $servers[$ext];

    $output = '';

    // connect to whois server:
    if ($conn = fsockopen ($nic_server, 43)) {
        fputs($conn, $domain."\r\n");
        while(!feof($conn)) {
            $output .= fgets($conn,128);
        }
        fclose($conn);
    }
    else { die('Error: Could not connect to ' . $nic_server . '!'); }

    return $output;
}

語法:

<?php
$domain = "http://www.blog.koonk.com";
$result = whois_query($domain);
print_r($result);
?>

9.驗證郵箱地址

有時候,當(dāng)在網(wǎng)站填寫表單鼓黔,用戶可能會輸入錯誤的郵箱地址央勒,這個函數(shù)可以驗證郵箱地址是否有效。

function is_validemail($email)
{
$check = 0;
if(filter_var($email,FILTER_VALIDATE_EMAIL))
{
$check = 1;
}
return $check;
}

語法:

<?php
$email = "blog@koonk.com";
$check = is_validemail($email);
echo $check;
// If the output is 1, then email is valid.
?>

10.獲取用戶的真實 IP

function getRealIpAddr()  
{  
    if (!emptyempty($_SERVER['HTTP_CLIENT_IP']))  
    {  
        $ip=$_SERVER['HTTP_CLIENT_IP'];  
    }  
    elseif (!emptyempty($_SERVER['HTTP_X_FORWARDED_FOR']))  
    //to check ip is pass from proxy  
    {  
        $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];  
    }  
    else  
    {  
        $ip=$_SERVER['REMOTE_ADDR'];  
    }  
    return $ip;  
}

語法:

<?php
$ip = getRealIpAddr();
echo $ip;
?>

11.轉(zhuǎn)換 URL:從字符串變成超鏈接

如果你正在開發(fā)論壇澳化,博客或者是一個常規(guī)的表單提交崔步,很多時候都要用戶訪問一個網(wǎng)站。使用這個函數(shù)肆捕,URL 字符串就可以自動的轉(zhuǎn)換為超鏈接刷晋。

function makeClickableLinks($text) 
{  
 $text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',  
 '<a href="\1">\1</a>', $text);  
 $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',  
 '\1<a href="http://\2">\2</a>', $text);  
 $text = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',  
 '<a href="mailto:\1">\1</a>', $text);  

return $text;  
}

語法:

<?php
$text = "This is my first post on http://blog.koonk.com";
$text = makeClickableLinks($text);
echo $text;
?>

12.阻止多個 IP 訪問你的網(wǎng)站

這個代碼片段可以方便你禁止某些特定的 IP 地址訪問你的網(wǎng)站。

if ( !file_exists('blocked_ips.txt') ) {
 $deny_ips = array(
  '127.0.0.1',
  '192.168.1.1',
  '83.76.27.9',
  '192.168.1.163'
 );
} else {
 $deny_ips = file('blocked_ips.txt');
}
// read user ip adress:
$ip = isset($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR']) : '';

// search current IP in $deny_ips array
if ( (array_search($ip, $deny_ips))!== FALSE ) {
 // address is blocked:
 echo 'Your IP adress ('.$ip.') was blocked!';
 exit;
}

13.強制性文件下載

如果你需要下載特定的文件而不用另開新窗口慎陵,下面的代碼片段可以幫助你眼虱。

function force_download($file) 
{ 
    $dir      = "../log/exports/"; 
    if ((isset($file))&&(file_exists($dir.$file))) { 
       header("Content-type: application/force-download"); 
       header('Content-Disposition: inline; filename="' . $dir.$file . '"'); 
       header("Content-Transfer-Encoding: Binary"); 
       header("Content-length: ".filesize($dir.$file)); 
       header('Content-Type: application/octet-stream'); 
       header('Content-Disposition: attachment; filename="' . $file . '"'); 
       readfile("$dir$file"); 
    } else { 
       echo "No file selected"; 
    } 
}

語法:

<php
force_download("image.jpg");
?>

14.創(chuàng)建 JSON 數(shù)據(jù)

使用下面的 PHP 片段可以創(chuàng)建 JSON 數(shù)據(jù),可以方便你創(chuàng)建移動應(yīng)用的 Web 服務(wù)席纽。

$json_data = array ('id'=>1,'name'=>"Mohit");
echo json_encode($json_data);

15.壓縮 zip 文件

使用下面的 PHP 片段可以即時壓縮 zip 文件捏悬。

function create_zip($files = array(),$destination = '',$overwrite = false) {  
    //if the zip file already exists and overwrite is false, return false  
    if(file_exists($destination) && !$overwrite) { return false; }  
    //vars  
    $valid_files = array();  
    //if files were passed in...  
    if(is_array($files)) {  
        //cycle through each file  
        foreach($files as $file) {  
            //make sure the file exists  
            if(file_exists($file)) {  
                $valid_files[] = $file;  
            }  
        }  
    }  
    //if we have good files...  
    if(count($valid_files)) {  
        //create the archive  
        $zip = new ZipArchive();  
        if($zip->open($destination,$overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE) !== true) {  
            return false;  
        }  
        //add the files  
        foreach($valid_files as $file) {  
            $zip->addFile($file,$file);  
        }  
        //debug  
        //echo 'The zip archive contains ',$zip->numFiles,' files with a status of ',$zip->status;  

        //close the zip -- done!  
        $zip->close();  

        //check to make sure the file exists  
        return file_exists($destination);  
    }  
    else  
    {  
        return false;  
    }  
}

語法:

<?php
$files=array('file1.jpg', 'file2.jpg', 'file3.gif');  
create_zip($files, 'myzipfile.zip', true); 
?>

16.解壓文件

function unzip($location,$newLocation)
{
        if(exec("unzip $location",$arr)){
            mkdir($newLocation);
            for($i = 1;$i< count($arr);$i++){
                $file = trim(preg_replace("~inflating: ~","",$arr[$i]));
                copy($location.'/'.$file,$newLocation.'/'.$file);
                unlink($location.'/'.$file);
            }
            return TRUE;
        }else{
            return FALSE;
        }
}

語法:

<?php
unzip('test.zip','unziped/test'); //File would be unzipped in unziped/test folder
?>

17.縮放圖片

function resize_image($filename, $tmpname, $xmax, $ymax)  
{  
    $ext = explode(".", $filename);  
    $ext = $ext[count($ext)-1];  

    if($ext == "jpg" || $ext == "jpeg")  
        $im = imagecreatefromjpeg($tmpname);  
    elseif($ext == "png")  
        $im = imagecreatefrompng($tmpname);  
    elseif($ext == "gif")  
        $im = imagecreatefromgif($tmpname);  

    $x = imagesx($im);  
    $y = imagesy($im);  

    if($x <= $xmax && $y <= $ymax)  
        return $im;  

    if($x >= $y) {  
        $newx = $xmax;  
        $newy = $newx * $y / $x;  
    }  
    else {  
        $newy = $ymax;  
        $newx = $x / $y * $newy;  
    }  

    $im2 = imagecreatetruecolor($newx, $newy);  
    imagecopyresized($im2, $im, 0, 0, 0, 0, floor($newx), floor($newy), $x, $y);  
    return $im2;   
}

18.使用 mail() 發(fā)送郵件

之前我們提供了如何使用 Mandrill 發(fā)送郵件的 PHP 代碼片段,但是如果你不想使用第三方服務(wù)润梯,那么可以使用下面的 PHP 代碼片段过牙。

function send_mail($to,$subject,$body)
{
$headers = "From: KOONK\r\n";
$headers .= "Reply-To: blog@koonk.com\r\n";
$headers .= "Return-Path: blog@koonk.com\r\n";
$headers .= "X-Mailer: PHP5\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to,$subject,$body,$headers);
}

語法:

<?php
$to = "admin@koonk.com";
$subject = "This is a test mail";
$body = "Hello World!";
send_mail($to,$subject,$body);
?>

19.把秒轉(zhuǎn)換成天數(shù)甥厦,小時數(shù)和分鐘

function secsToStr($secs) {
    if($secs>=86400){$days=floor($secs/86400);$secs=$secs%86400;$r=$days.' day';if($days<>1){$r.='s';}if($secs>0){$r.=', ';}}
    if($secs>=3600){$hours=floor($secs/3600);$secs=$secs%3600;$r.=$hours.' hour';if($hours<>1){$r.='s';}if($secs>0){$r.=', ';}}
    if($secs>=60){$minutes=floor($secs/60);$secs=$secs%60;$r.=$minutes.' minute';if($minutes<>1){$r.='s';}if($secs>0){$r.=', ';}}
    $r.=$secs.' second';if($secs<>1){$r.='s';}
    return $r;
}

語法:

<?php
$seconds = "56789";
$output = secsToStr($seconds);
echo $output;
?>

20.數(shù)據(jù)庫連接

連接 MySQL 數(shù)據(jù)庫。

<?php
$DBNAME = 'koonk';
$HOST = 'localhost';
$DBUSER = 'root';
$DBPASS = 'koonk';
$CONNECT = mysql_connect($HOST,$DBUSER,$DBPASS);
if(!$CONNECT)
{
    echo 'MySQL Error: '.mysql_error();
}
$SELECT = mysql_select_db($DBNAME);
if(!$SELECT)
{
    echo 'MySQL Error: '.mysql_error();
}
?>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末寇钉,一起剝皮案震驚了整個濱河市刀疙,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌扫倡,老刑警劉巖谦秧,帶你破解...
    沈念sama閱讀 217,406評論 6 503
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異撵溃,居然都是意外死亡疚鲤,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,732評論 3 393
  • 文/潘曉璐 我一進(jìn)店門缘挑,熙熙樓的掌柜王于貴愁眉苦臉地迎上來集歇,“玉大人,你說我怎么就攤上這事语淘』逵睿” “怎么了?”我有些...
    開封第一講書人閱讀 163,711評論 0 353
  • 文/不壞的土叔 我叫張陵惶翻,是天一觀的道長焕窝。 經(jīng)常有香客問我,道長维贺,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,380評論 1 293
  • 正文 為了忘掉前任巴帮,我火速辦了婚禮溯泣,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘榕茧。我一直安慰自己垃沦,他們只是感情好,可當(dāng)我...
    茶點故事閱讀 67,432評論 6 392
  • 文/花漫 我一把揭開白布用押。 她就那樣靜靜地躺著肢簿,像睡著了一般。 火紅的嫁衣襯著肌膚如雪蜻拨。 梳的紋絲不亂的頭發(fā)上池充,一...
    開封第一講書人閱讀 51,301評論 1 301
  • 那天,我揣著相機與錄音缎讼,去河邊找鬼收夸。 笑死,一個胖子當(dāng)著我的面吹牛血崭,可吹牛的內(nèi)容都是我干的卧惜。 我是一名探鬼主播厘灼,決...
    沈念sama閱讀 40,145評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼咽瓷!你這毒婦竟也來了设凹?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,008評論 0 276
  • 序言:老撾萬榮一對情侶失蹤茅姜,失蹤者是張志新(化名)和其女友劉穎闪朱,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體匈睁,經(jīng)...
    沈念sama閱讀 45,443評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡监透,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,649評論 3 334
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了航唆。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片胀蛮。...
    茶點故事閱讀 39,795評論 1 347
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖糯钙,靈堂內(nèi)的尸體忽然破棺而出粪狼,到底是詐尸還是另有隱情,我是刑警寧澤任岸,帶...
    沈念sama閱讀 35,501評論 5 345
  • 正文 年R本政府宣布再榄,位于F島的核電站,受9級特大地震影響享潜,放射性物質(zhì)發(fā)生泄漏困鸥。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,119評論 3 328
  • 文/蒙蒙 一剑按、第九天 我趴在偏房一處隱蔽的房頂上張望疾就。 院中可真熱鬧,春花似錦艺蝴、人聲如沸猬腰。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,731評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽姑荷。三九已至,卻和暖如春缩擂,著一層夾襖步出監(jiān)牢的瞬間鼠冕,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,865評論 1 269
  • 我被黑心中介騙來泰國打工撇叁, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留供鸠,地道東北人。 一個月前我還...
    沈念sama閱讀 47,899評論 2 370
  • 正文 我出身青樓陨闹,卻偏偏與公主長得像楞捂,于是被迫代替她去往敵國和親薄坏。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,724評論 2 354

推薦閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 172,110評論 25 707
  • ¥開啟¥ 【iAPP實現(xiàn)進(jìn)入界面執(zhí)行逐一顯】 〖2017-08-25 15:22:14〗 《//首先開一個線程寨闹,因...
    小菜c閱讀 6,409評論 0 17
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理胶坠,服務(wù)發(fā)現(xiàn),斷路器繁堡,智...
    卡卡羅2017閱讀 134,654評論 18 139
  • 說起來沈善,心里有點淡淡的憂傷,從事教育教學(xué)工作已經(jīng)五年了椭蹄,可是自己仍然誠惶誠恐闻牡,總是覺得自己做不好。做工作總是...
    smile不拒微笑閱讀 244評論 0 1
  • -1- 經(jīng)常有讀者在后臺問我:“Jackie,我還有幾個月就要考雅思了翼馆,可我現(xiàn)在只有6分的水平割以,怎樣才能快速進(jìn)步到...
    朗閣阿蘇閱讀 1,156評論 0 8