{"id":20575,"date":"2023-02-14T01:31:06","date_gmt":"2023-02-13T16:31:06","guid":{"rendered":"http:\/\/hyunsik.me\/wordpress\/?p=20575"},"modified":"2023-11-01T00:26:24","modified_gmt":"2023-10-31T15:26:24","slug":"tmi-php-%ed%95%9c%ea%b8%80-%eb%ac%b8%ec%9e%90%ec%97%b4-%ec%9e%90%eb%a5%b4%ea%b8%b0-%ed%95%a8%ec%88%98","status":"publish","type":"post","link":"http:\/\/hyunsik.me\/wordpress\/?p=20575","title":{"rendered":"[\uc815\ubcf4] \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30 PHP \ud568\uc218"},"content":{"rendered":"<p>PHP\uc5d0\uc11c \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30\ub294 \uc5ec\ub7ec \uac00\uc9c0 \uc774\uc720\ub85c \uc0dd\uac01\ubcf4\ub2e4 \uc798 \uc548\ub418\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4. \uc544\ub798 \ud568\uc218\uac00 \uc9c0\uae08\uae4c\uc9c0 \uc0ac\uc6a9\ud55c \uac83 \uc911 \uac00\uc7a5 \uc644\ubcbd\ud55c \ud568\uc218\uc774\ub2e4.<\/p>\n<ul>\n<li> \uc5ec\uae30\uae4c\uc9c0 \uc654\ub2e4\uba74 \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30 \ud568\uc218\uc758 \ub2e4\uc591\ud55c \uace0\ubbfc\uc5d0 \ub300\ud574 \uc798 \uc54c\uace0 \uc788\uc744 \uac83\uc774\ub2e4. \ub610\ud55c \ub354 \uc88b\uc740 \uac83\uc774 \uc788\ub2e4\uba74 \ub313\uae00\ub85c \ub2f5\ubcc0\uc744 \ud574\uc904 \uac83\uc774\ub77c \uad73\uac8c \ubbff\ub294\ub2e4. <\/li>\n<li> \ubaa8\ub450 chatGPT\uac00 \ub9cc\ub4e4\uc5b4\uc900 \ud568\uc218\uc774\ub2e4.(\ud568\uc218 \uc774\ub984\ub9cc \uc81c\uc678) <\/li>\n<\/ul>\n<p><strong style=\"color:red\">[1] PHP \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30 \ud568\uc218<\/strong><\/p>\n<p style=\"text-align: center;\"><img src=\"http:\/\/hyunsik.me\/wordpress\/wp-content\/uploads\/2023\/02\/20230218_034632.png\" alt=\"\" width=\"568\" \/> <\/p>\n<pre style=\"font-family: NanumGothic; background-color: #e3e3f3; padding: 5px;color:blue;font-weight:bold;\">\r\n\tfunction cut_korean_string($str, $length) {\r\n\t    if (mb_strlen($str, 'utf-8') > $length) {\r\n\t        $str = mb_substr($str, 0, $length, 'utf-8');\r\n\t        $str .= '...';\r\n\t    }\r\n\t    return $str;\r\n\t}\r\n<\/pre>\n<p><strong style=\"color:red\">[2] \uc790\ub978 \ubb38\uc790\uc5f4\uc758 \ub9c8\uc9c0\ub9c9 \ubb38\uc790\uac00 2\ubc14\uc774\ud2b8\uc778 \uacbd\uc6b0 \ud55c\uae00 \ubb38\uc790\uc5f4\uc774 \uae68\uc9c0\uc9c0 \uc54a\ub294 \ucc98\ub9ac\uac00 \ucd94\uac00\ub41c \ud568\uc218 <\/strong><\/p>\n<p style=\"text-align: center;\"><img src=\"http:\/\/hyunsik.me\/wordpress\/wp-content\/uploads\/2023\/02\/20230218_041016.png\" alt=\"\" width=\"778\"\/><\/p>\n<pre style=\"font-family: NanumGothic; background-color: #e3e3f3; padding: 5px;color:blue;font-weight:bold;\">\r\n        function cut_korean_string($str, $len, $suffix='...') {\r\n\t     $str = filter_var(trim($str), FILTER_SANITIZE_STRING);\r\n\t     $encoding = 'UTF-8';  \/\/ \ud55c\uae00 \ubb38\uc790\uc5f4\uc740 \ub300\ubd80\ubd84 UTF-8\ub85c \uc778\ucf54\ub529\ub429\ub2c8\ub2e4.\r\n\t     $str_len = mb_strlen($str, $encoding);\r\n\t     if ($str_len <= $len) {\r\n\t         return $str;\r\n\t     } else {\r\n\t         $cut_str = mb_substr($str, 0, $len, $encoding);\r\n\t         \/\/ \uc790\ub978 \ubb38\uc790\uc5f4\uc758 \ub9c8\uc9c0\ub9c9 \ubb38\uc790\uac00 2\ubc14\uc774\ud2b8 \ubb38\uc790\uc778 \uacbd\uc6b0 \ud55c\uae00 \ubb38\uc790\uc5f4\uc774 \uae68\uc9c0\uc9c0 \uc54a\ub3c4\ub85d \ucc98\ub9ac\ud569\ub2c8\ub2e4.\r\n\t         if (mb_strlen($cut_str, $encoding) < $str_len) {\r\n\t             $last_char = mb_substr($str, $len - 1, 1, $encoding);\r\n\t             if (mb_strlen($last_char, $encoding) === 2) { \/\/===\uc740 \ucc98\uc74c \ubcf8\ub2e4.\r\n\t                 $cut_str = mb_substr($cut_str, 0, $len - 1, $encoding);\r\n\t             }\r\n\t         }\r\n\t         return $cut_str . $suffix;\r\n\t     }\r\n          }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PHP\uc5d0\uc11c \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30\ub294 \uc5ec\ub7ec \uac00\uc9c0 \uc774\uc720\ub85c \uc0dd\uac01\ubcf4\ub2e4 \uc798 \uc548\ub418\ub294 \uacbd\uc6b0\uac00 \ub9ce\ub2e4. \uc544\ub798 \ud568\uc218\uac00 \uc9c0\uae08\uae4c\uc9c0 \uc0ac\uc6a9\ud55c \uac83 \uc911 \uac00\uc7a5 \uc644\ubcbd\ud55c \ud568\uc218\uc774\ub2e4. \uc5ec\uae30\uae4c\uc9c0 \uc654\ub2e4\uba74 \ud55c\uae00 \ubb38\uc790\uc5f4 \uc790\ub974\uae30 \ud568\uc218\uc758 \ub2e4\uc591\ud55c \uace0\ubbfc\uc5d0 \ub300\ud574 \uc798 \uc54c\uace0 \uc788\uc744 \uac83\uc774\ub2e4. \ub610\ud55c \ub354 \uc88b\uc740 \uac83\uc774 \uc788\ub2e4\uba74 \ub313\uae00\ub85c \ub2f5\ubcc0\uc744 \ud574\uc904 \uac83\uc774\ub77c \uad73\uac8c \ubbff\ub294\ub2e4. \ubaa8\ub450 chatGPT\uac00 \ub9cc\ub4e4\uc5b4\uc900 \ud568\uc218\uc774\ub2e4.(\ud568\uc218 \uc774\ub984\ub9cc \uc81c\uc678) [1] PHP \ud55c\uae00 \ubb38\uc790\uc5f4 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[2290],"tags":[38,2502,3197,3198,3000,3199],"jetpack_featured_media_url":"","views":"","jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20575"}],"collection":[{"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20575"}],"version-history":[{"count":30,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20575\/revisions"}],"predecessor-version":[{"id":22694,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/20575\/revisions\/22694"}],"wp:attachment":[{"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20575"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hyunsik.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}