1 개요
- PHP str_starts_with()
PHP
Copy
<?php
if (str_starts_with('abc', '')) {
echo "모든 문자열은 빈 문자열로 시작한다";
}
Loading
PHP
Copy
<?php
$string = 'The lazy fox jumped over the fence';
if (str_starts_with($string, 'The')) {
echo "문자열이 'The'로 시작한다\n";
}
if (str_starts_with($string, 'the')) {
echo '문자열이 "the"로 시작한다';
} else {
echo '대소문자가 맞지 않아서 "the"를 찾을 수 없다';
}
Loading
2 같이 보기
- PHP str_contains() - Determine if a string contains a given substring
- PHP str_ends_with() - Checks if a string ends with a given substring
- PHP stripos() - Find the position of the first occurrence of a case-insensitive substring in a string
- PHP strrpos() - Find the position of the last occurrence of a substring in a string
- PHP strripos() - Find the position of the last occurrence of a case-insensitive substring in a string
- PHP strstr() - Find the first occurrence of a string
- PHP strpbrk() - Search a string for any of a set of characters
- PHP substr() - Return part of a string
- PHP preg_match() - Perform a regular expression match
- 함수 str_starts_with()
3 참고
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.