strpos > Web 끄적임

본문 바로가기
사이트 내 전체검색

Web 끄적임

PHP strpos

페이지 정보

profile_image
작성자 관리자
댓글 0건 조회 9,909회 작성일 20-09-18 09:48

본문

(PHP 4, PHP 5, PHP 7)

strpos — Find the position of the first occurrence of a substring in a string
문자열에서 부분 문자열의 첫 번째 위치의 위치를 찾습니다.

$newstring = 'abcdef abcdef';
$pos = strpos($newstring, 'a', 1); // $pos = 7, not 0



$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);

if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}
추천0 비추천0

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

접속자집계

오늘
1,034
어제
1,303
최대
2,110
전체
58,340
접속자 : 13 모바일버전

Copyright © NEION All rights reserved.