![](/bink.gif) |
|
| ![](/bink.gif) |
°Ô½ÃÆÇ¿¡ syntax highlight Àû¿ëÇϱâ |
|
|
![](icon/private_name/1.gif) |
14³â Àü |
http://alexgorbatchev.com/
¿¡¼ ÇÁ·Î±×·¥À» ¹Þ¾Æ À¥¿¡ ¾÷·Îµå ÇÑ ÈÄ
±×´©º¸µå¿¹)
<script type="text/javascript" src="<?=$g4['path']?>/js/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="<?=$g4['path']?>/js/syntaxhighlighter/scripts/shBrushPhp.js"></script>
<link type="text/css" rel="stylesheet" href="<?=$g4['path']?>/js/syntaxhighlighter/styles/shCore.css"/>
<link type="text/css" rel="stylesheet" href="<?=$g4['path']?>/js/syntaxhighlighter/styles/shThemeDefault.css"/>
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '<?=$g4['path']?>/js/syntaxhighlighter/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
ÀÌ·±½ÄÀ¸·Î Àû¿ëÇÕ´Ï´Ù.
skin/board/basic/view.skin.php ¿¡
<!-- ³»¿ë Ãâ·Â -->
<span id="writeContents">
<?
function _preg_callback($m)
{
$str = str_replace(array("<br/>", " "), array("\n", " "), $m[1]);
return "<pre class='brush:php;'>$str</pre>";
}
$str = $view[content];
$str = preg_replace_callback("/\[code\](.*)\[\/code\]/iU", "_preg_callback", $str);
echo $str;
?>
</span>
¿Í °°ÀÌ Äڵ带 ¼öÁ¤ÇÕ´Ï´Ù.
±ÛÀÛ¼º½Ã
php Äڵ忡 £Ûcode£Ý ... £Û/code£Ý·Î °¨½ÎÁÖ½Ã¸é µË´Ï´Ù.
¿¹)
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=155236 |
|
̵̧ : 329 |
̵̧
¸ñ·Ï
|
|
| ![](/bink.gif) |
|