“말은 쉽지, 코드를 보여줘.”

이름 별표 처리 본문

php / codeigniter

이름 별표 처리

디츠 2015.07.14 12:53

 if($key == "관리자" || $key == "administrator"):
  $html = $key;
 else:
  $len = mb_strlen($key,"utf-8");
  $start = round($len / 3);

  $dot = "";
  for($i = $start;$i < $len;$i++):
   $dot .= ".";
  endfor;
  
  $pattern = "/.(?!".$dot.")/u";
  $html = preg_replace($pattern,'○',$key);
 endif;

 return $html;

신고

'php / codeigniter' 카테고리의 다른 글

php 헤더 정보 보기  (0) 2015.07.15
한글 포함 여부  (0) 2015.07.14
이름 별표 처리  (2) 2015.07.14
fpdf - pdf 만들기  (0) 2015.06.10
태그제거, 태그안의 내용만 추출  (0) 2015.06.09
remove_xss 함수  (0) 2015.05.12
2 Comments
  • 프로필사진 leather pandora bracelet sale 2017.04.17 15:56 신고 에서Once again,pandora grey leather bracelet, Owens quite literally stuck a cock in the face of the fashion conglomerates,puma new shoes,“People think a lot of my motivation is very megalomaniac and self-oriented. But what’s a Kanye interview without some controversy? Instead of 16 GB No Matter How Hard I Try I Just Can’t Seem to Like Beyonce This Is Kanye West’s Yeezy Season 2 Boot Releasing in June 일하
  • 프로필사진 adidas track order 2017.08.08 23:12 신고 지지although I spent my entire life traveling,adidas clearance shoes, with Linda joining me after college, so I took the vanguard and put the shower on image.
    but single stone balanced upon single stone and so on. Spain occupied northern Morocco and ushered in a half century of trade rivalry among European powers that saw Morocco's sovereignty steadily eroded; in 1912, Morocco virtually annexed We지려
댓글쓰기 폼