function ºÎºÐ »ðÀÔÇØÁÖ°í
$subject= $data[subject]; ºÎºÐ »ì·ÁµÐä
$subject = kstrcut($subject, '30', "..."); ¸¦ ³Ö¾ù½À´Ï´Ù
Àß Ãâ·ÂµÇ³×¿ä
´äº¯ °¨»çÇÕ´Ï´Ù.
´Ùµé ÇÁ·Î±Þµé À̽ŵ¥ Ȥ½Ã Àú°°ÀÌ php¸¦ ¸ð¸£´ÂºÐÀ» À§ÇØ Á¦È¨¿¡ Àû¿ëÇÑ´ë·Î Àû¾î ³õ°Ú½À´Ï´Ù
Á¦·Îº¸µå 1°³ °Ô½ÃÆÇ¿¡¼ ÀÓÀÇ·Î(·£´ý) 1°³ÀÇ °Ô½Ã¹° Á¦¸ñÀ» ÃßÃâÇÏ¿© Ç¥±âÇÏ°í ±× ºÎºÐ¿¡ ¸µÅ©°¡ °É¸®µµ·Ï ÇÏ´Â ¼Ò½º ÀÔ´Ï´Ù
//--------------------------------------------------------
<?
mysql_connect("localhost","¾ÆÀ̵ð","µðºñºñ¹ø");
mysql_select_db("µðºñ³×ÀÓ");
// $zb_url = "http://www.XXXX.com/boa/"; // À¥ÆäÀÌÁö»ó´Ü¿¡ ¾Èµé¾î°¥¶§ ¿äºÎºÐÀ» Àû¿ë½ÃÅ´
//$img_name="quetion_s.gif";
$bbs_name="see"; // see´Â °Ô½ÃÆÇ ¾ÆÀ̵ð
// µ¥ÀÌÅ͸¦ ºÒ·¯¿È
$result=mysql_query("SELECT * FROM zetyx_board_".$bbs_name." ORDER BY rand() LIMIT 1");
// Ãâ·Â
while($data=mysql_fetch_array($result)) {
$subject= $data[subject];
$subject = kstrcut($subject, '30', "..."); // ±ÛÀÚ¼ö ÀÚ¸£±â
echo"<a href='".$zb_url."zboard.php?id=see&page=$href&no=$data[no]'>".$subject."</a>"; // see´Â °Ô½ÃÆÇ ¾ÆÀ̵ð
}
function kstrcut($str, $len, $suffix){
if ($len >= strlen($str)) return $str;
$klen = $len - 1;
while(ord($str[$klen]) & 0x80) $klen--;
return substr($str, 0, $len - (($len + $klen + 1) % 2)) . $suffix;
}
?>
//----------------------------------------------------------------