一直喜歡ue9裡面對php的預設色彩設定,橙色紅色的,ue10改成關鍵字藍色了,我又改回來了:
現在想試試php.exe的代碼高亮輸出與我的喜好一致,仔細調了一下php.ini,並嘗試了一些新顏色:
highlight.string = #808080
highlight.comment = #008000
highlight.keyword = #FF8000
highlight.bg = #E0E0E0
highlight.default = #800000
highlight.html = #0080FF
然後php -q -s test.php>test.html
下面是效果:
<?php
$a='123';
$b='abc';
?>
<table>
<tr><td>
<?php
//comments
if(true)
{
echo $a.$b;
}
?>
</td></tr>
</table>
補:但是也不能只顧自己欣賞,代碼是給人看的,上網看了很多其他的色彩配置,總結一下:
1。剛才那樣就是ue9的風格,關鍵字橙色,變數深紅,字串灰色,注釋深綠,html藍色
2。php.net官網所有的代碼舉例採用了php.ini的預設配置色彩,關鍵字綠色,字串紅色,注釋橙色,html黑色,普通文字(變數和其他標識符)藍色:
// How to hold objects in an arrayList and retrieve it //
// Interface implementation //
class Data {
public $Name;
public $Age;
public $Address;
public function __construct($Name,$Age,$Address) {
$this->Name = $Name;
$this->Age = $Age;
$this->Address = $Address;
}
public function __destruct() {
echo "Default Constructor.../n";
}
}
3。很奇怪pear官網的大部分代碼舉例採用了另一種色彩,關鍵字紫色,字串綠色,注釋灰色普通文字藍色:
// Create a Cache_Lite object$Cache_Lite = new Cache_Lite($options);if ($data = $Cache_Lite->get('block1')) { echo($data);} else { $data = 'Data of the block 1'; $Cache_Lite->save($data);}
4。當然還逃不了一種色彩,就是MS VS風格的,很多win下的php編輯器喜歡用,ue10, phpedit, devphp, zendstudio等,關鍵字藍色,注釋綠色,(有時候還有字串灰色,數字紅色等),其他黑色