ตัวอย่าง Ruby code
#!/usr/bin/ruby
string1 = "I will drill for a well in walla walla washington."
regex = Regexp.new(/(w.ll).*(in).*(w.ll)/)
matchdata = regex.match(string1)
if matchdata
for ss in 0...matchdata.length
puts matchdata[ss]
end
else
puts "NO MATCH"
end
ตัวอย่าง CSS code
.node-unpublished {
background-color: #fff4f4;
}
.preview .node {
background-color: #ffffea;
}
#node-admin-filter ul {
list-style-type: none;
padding: 0;
margin: 0;
width: 100%;
}
#node-admin-buttons {
float: left; /* LTR */
margin-left: 0.5em; /* LTR */
clear: right; /* LTR */
}
td.revision-current {
background: #ffc;
}
ตัวอย่าง PHP Code
<?php
$number = 1234.567;
// First method
echo sprintf('%.2f €', $number); // 1234.57 €
// Second method
echo number_format($number, 2, ',', ' ') . ' €'; // 1 234,57 €
// Third method
setlocale(LC_MONETARY, 'en_US');
echo money_format('%n', $number); // $1,234.57
setlocale(LC_MONETARY, 'fr_FR');
echo money_format('%n', $number); // 1 234,57 Eu
echo money_format('%!n €', $number); // 1 234,57 €
?>
แต่รู้สึกจะมีปัญหากับ < > ซึ่งต้องใช้ < และ > แทนไม่งั้นมันจะไม่แสดงผล
สำหรับคนที่อยากใช้ก็ให้ไปโหลด SyntaxHighlighter แล้วหาโฮสทลง script แล้วเรียกใช้จาก Blogger ได้ครับ
No comments:
Post a Comment