문자열 자르기, substr()
제가 자주 사용하는 PHP 내장함수입니다.
홈페이지 제작시 서브메뉴 스타일 지정이나, 롤오버 표현할때 많이 이용합니다.
<?php
$rest = substr("abcdef", 0, -1); // returns "abcde"
$rest = substr("abcdef", 2, -1); // returns "cde"
$rest = substr("abcdef", 4, -4); // returns false
$rest = substr("abcdef", -3, -1); // returns "de"
?>
댓글 1개
코드오타쿠
3년 전
bbbb
게시판 목록
개발자팁
개발과 관련된 유용한 정보를 공유하세요.
질문은 QA에서 해주시기 바랍니다.
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4796 | jQuery | 8년 전 | 1544 | ||
| 4795 | jQuery | 8년 전 | 1447 | ||
| 4794 | jQuery | 8년 전 | 1569 | ||
| 4793 | jQuery | 8년 전 | 1623 | ||
| 4792 | jQuery | 8년 전 | 1638 | ||
| 4791 | jQuery | 8년 전 | 1799 | ||
| 4790 | jQuery | 8년 전 | 1737 | ||
| 4789 | jQuery | 8년 전 | 1600 | ||
| 4788 | jQuery | 8년 전 | 1663 | ||
| 4787 | jQuery | 8년 전 | 1476 | ||
| 4786 | jQuery | 8년 전 | 1437 | ||
| 4785 | jQuery | 8년 전 | 1650 | ||
| 4784 | jQuery | 8년 전 | 1534 | ||
| 4783 | jQuery | 8년 전 | 1241 | ||
| 4782 | jQuery | 8년 전 | 1605 | ||
| 4781 | jQuery | 8년 전 | 1345 | ||
| 4780 | jQuery | 8년 전 | 1579 | ||
| 4779 | jQuery | 8년 전 | 1988 | ||
| 4778 | jQuery | 8년 전 | 1963 | ||
| 4777 | jQuery | 8년 전 | 1537 | ||
| 4776 | jQuery | 8년 전 | 1590 | ||
| 4775 | jQuery | 8년 전 | 1976 | ||
| 4774 | jQuery | 8년 전 | 1493 | ||
| 4773 | jQuery | 8년 전 | 1417 | ||
| 4772 | jQuery | 8년 전 | 2210 | ||
| 4771 | jQuery | 8년 전 | 3623 | ||
| 4770 | PHP | 8년 전 | 5588 | ||
| 4769 | 기타 | 8년 전 | 1969 | ||
| 4768 | 기타 | 8년 전 | 1788 | ||
| 4767 | 기타 | 8년 전 | 2074 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기