strpos
페이지 정보
본문
(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";
}
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";
}
- 이전글time() -> date로 변환 20.09.18
- 다음글NicEdit Upload php file 20.09.18
댓글목록
등록된 댓글이 없습니다.