{"id":"2860","url":"https://rhkorea.com/post/2860","title":"제목 짜르기......\r\n","author":{"display_name":"동서기"},"published_at":"2000-11-04T04:26:07.000Z","updated_at":null,"content_text":"한 번 연구해봐..... 내가 만든 PHP 게시판에서 사용중인거다.... $title_length_limit = 60 - $thread_length; $title_length = strlen($ctitle); if ($title_length > $title_length_limit) { $han_count=0; for ($j = 0; $j < $title_length_limit ; $j++) { $han = ord(substr($ctitle,$j,1)); if(($han & 0x80)==128) { $han_count++; } } $mod=$han_count % 2; if($mod == 0) { $ctitle = substr($ctitle , 0, $title_length_limit); $ctitle = $ctitle . \"...\"; } else { $title_length_limit = $title_length_limit + 1; $ctitle = substr($ctitle,0,$title_length_limit); $ctitle = $ctitle . \"...\"; } }","content_html":"한 번 연구해봐.....<br />\r\n내가 만든 PHP 게시판에서 사용중인거다....<br />\r\n<br />\r\n$title_length_limit = 60 - $thread_length;<br />\r\n\t$title_length = strlen($ctitle);<br />\r\n\tif ($title_length &gt; $title_length_limit)<br />\r\n\t{<br />\r\n\t\t$han_count=0;<br />\r\n\t\tfor ($j = 0; $j &lt; $title_length_limit ; $j++)<br />\r\n\t\t{ <br />\r\n\t\t\t$han = ord(substr($ctitle,$j,1)); <br />\r\n\t\t\tif(($han &amp; 0x80)==128)<br />\r\n\t\t\t{ <br />\r\n\t\t\t$han_count++; <br />\r\n\t\t\t} <br />\r\n\t\t}<br />\r\n\t\t$mod=$han_count % 2; <br />\r\n\t\tif($mod == 0)<br />\r\n\t\t{ <br />\r\n\t\t$ctitle = substr($ctitle , 0, $title_length_limit); <br />\r\n\t\t$ctitle = $ctitle . \"...\"; <br />\r\n\t\t}<br />\r\n\t\telse<br />\r\n\t\t{ <br />\r\n\t\t\t$title_length_limit = $title_length_limit + 1; <br />\r\n\t\t\t$ctitle = substr($ctitle,0,$title_length_limit); <br />\r\n\t\t\t$ctitle = $ctitle . \"...\"; <br />\r\n\t\t} <br />\r\n\t}<br />\r\n","comments_count":0,"related_services":{"okcomputer":{"url":"https://rhkorea.com/okcom","guide":"https://rhkorea.com/okcom/guide.md","html":"https://rhkorea.com/okcom/read","feedback_form":"https://rhkorea.com/okcom/feedback","source_url":"https://rhkorea.com/post/2860","optional":true}}}