코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>PHP Built In Function</title> </head> <body> <?php $str = "한글로된문자열"; echo strlen($str)."<br>"; // 7 * 3 = 21 echo mb_strlen($str)."<br>"; // 7 * 3 = 21 echo mb_strlen($str, "UTF-8"); // 7 ?> </body> </html>