웹마스터 팁
page_full_width">
원고지 함수;;
2002.02.07 15:47
이지보드의 원고지스킨을 보구 php로 만들어보았습니다
자바스크립으로하는게 더 좋을듯;;;
http://jamaica.iyedong.net/this/wongoji.php
<?php
function wongoji($str,$width)
{
// 한자씩 잘라서 배열로....
$lenth = strlen($str);
for ($pos = 0 ; $pos < $lenth ; $pos = $pos + $s_pos ) {
$s_pos = 1;
$sub = substr($str,$pos,1);
if(ord($sub) >= 127) $s_pos++;
$sub = substr($str,$pos,$s_pos);
$sub_char[] = $sub;
} // 만들고;;
$height = ceil(count($sub_char) / $width); // 원고지의 세로 칸수
echo "<table cellspacing='0' border='1' bordercolor=#F38885>";
for ($h = 0 ; $h < $height ; $h++) {
$start_h = $width * $h; //세로 첫칸에 시작할 s_word의 키값-_-;;
echo "<tr>";
for($w = 0 ; $w <= $width ; $w++) {
echo "<td width='20' height='20' align='center'><img src=blank.gif width='0'>$sub_char[$start_h]</td>";
$start_h++;
}
echo "</tr>";
}
echo "</table>";
}
$str = "Mysql 4.0.1 개발 버젼이 발표되었습니다.자세한 내용은 http://www.mysql.com/ 에서 확인하시길 바랍니다.";
wongoji($str,25);
?>
자바스크립으로하는게 더 좋을듯;;;
http://jamaica.iyedong.net/this/wongoji.php
<?php
function wongoji($str,$width)
{
// 한자씩 잘라서 배열로....
$lenth = strlen($str);
for ($pos = 0 ; $pos < $lenth ; $pos = $pos + $s_pos ) {
$s_pos = 1;
$sub = substr($str,$pos,1);
if(ord($sub) >= 127) $s_pos++;
$sub = substr($str,$pos,$s_pos);
$sub_char[] = $sub;
} // 만들고;;
$height = ceil(count($sub_char) / $width); // 원고지의 세로 칸수
echo "<table cellspacing='0' border='1' bordercolor=#F38885>";
for ($h = 0 ; $h < $height ; $h++) {
$start_h = $width * $h; //세로 첫칸에 시작할 s_word의 키값-_-;;
echo "<tr>";
for($w = 0 ; $w <= $width ; $w++) {
echo "<td width='20' height='20' align='center'><img src=blank.gif width='0'>$sub_char[$start_h]</td>";
$start_h++;
}
echo "</tr>";
}
echo "</table>";
}
$str = "Mysql 4.0.1 개발 버젼이 발표되었습니다.자세한 내용은 http://www.mysql.com/ 에서 확인하시길 바랍니다.";
wongoji($str,25);
?>
댓글 3
-
세라믹스
2002.02.07 21:21
-
jamaica
2002.02.09 23:04
혀;;형 -
error
2002.02.16 00:10
디스;
원고지 한칸에는 영어는 2자, 숫자 또는 소수점은 세글자씩 들어가게 돼있는데..