發表文章

目前顯示的是 4月, 2018的文章

Latest

英文、中文 / 諺語、片語、成語、口語對照 (2025.08.25 更新)

做表面功夫 go through the motion 目中無人;自視甚高 have one's nose in the air 有完沒完;別再說了 give it a rest  = can in 兵來將擋,水來土掩 roll with the punches (衍伸至拳擊) = take it as it comes 時間過得好慢。 The day is dragging on. 少臭美了 be full of oneself = Get over yourself! 你真是自以為是。 You are really all about yourself. 你一定找得到的。 You can't miss it. 那還用說。 You're telling me. 物超所值 get more bang for the buck 加把勁 pull one's socks up 出洋相;大吵大鬧 make a scene 風馬牛不相及 be neither here nor there 挖東牆補西牆 rob Peter to pay Paul 我覺得事有蹊蹺。 I smell a rat.  冤冤相報何時了。 Two wrongs don't make a right. 沒魚,蝦也好。 It's not so great, but it'll have to do.  自斷後路 burn one's bridge  這是掛保證的。 You can take it to the bank.  = You can quote me on that. 白手起家 rags-to-riches 放規矩點! Behave youself. = Mind your p's and q's. 悉聽尊便。 Anything you say. = It's up to you. = As you wish. 夠了!(住嘴) Cut it out! = Stop it! 閉嘴! Hold your tongue. = Shut up! 別太挑剔了! Don't be so fussy. 別搞砸了! Don't blow it. 別老叫我做東做西! Don't boss me arou...

FB 別名 名稱類型

圖片
原來有這麼多種...

foreach 的 reference

<?php $arr = array(1, 2, 3, 4); foreach ($arr as &$value) {     $value = $value * 2; }// $arr is now array(2, 4, 6, 8) // without an unset($value), $value is still a reference to the last item: $arr[3] foreach ($arr as $key => $value) {     // $arr[3] will be updated with each value from $arr...     echo "{$key} => {$value} ";     print_r($arr); }// ...until ultimately the second-to-last value is copied onto the last value // output: // 0 => 2 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 2 ) // 1 => 4 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 4 ) // 2 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 ) // 3 => 6 Array ( [0] => 2, [1] => 4, [2] => 6, [3] => 6 ) ?> &是使用到reference 以上轉載於 http://php.net/manual/en/control-structures.foreach.php 我本來看不懂,後來找到了答案→ http://ccckaass.pixnet.net/blog/post/298283101-%5bphp%5d-foreach%E7%9A%84%26%28%E5%8F%...

PHP 之 str_pad() 和 strlen() 和 mb_strlen()

<?php $value = '王羲之'; $value_sub = substr($value,0,3); $value_strlen = strlen($value); $value_pad = str_pad($value_sub, $value_strlen, '*', STR_PAD_RIGHT); echo $value_sub; //印出 王 echo $value_strlen; //印出 9 echo $value_pad; //印出 王****** $value = 'Tyler'; $value_sub = substr($value,0,3); $value_strlen = strlen($value); $value_pad = str_pad($value_sub, $value_strlen, '*', STR_PAD_RIGHT); echo $value_sub; //印出 Tyl echo $value_strlen; //印出 5 echo $value_pad; //印出 Tyl** ?> - - - 使用strlen()每個中文字它會算成3 bytes str_pad()是將字串補成指定長度的方法~ 判斷繁體中文字的方法有mb_strlen() 會多一個編碼參數如mb_strlen($value,"utf-8")