1. strpos()함수 //stripos()는 대소문자를 구분하지 않습니다. )
- haystack
-
The string to search in
- needle
-
If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.
- offset
-
The optional offset parameter allows you to specify which character in haystack to start searching. The position returned is still relative to the beginning of haystack.
haystack 문자열에서 마지막으로 나오는 needle 의 위치를 수로 반환합니다. PHP 4에서 needle은 하나의 문자만 사용할 수 있습니다. 문자열을 needle로 전달하면, 문자열의 첫번째 문자만을 사용합니다.
needle 이 발견되지 않으면, FALSE를 반환합니다.
3. string strrchr ( string $haystack , mixed $needle )
이 함수는 needle 가 마지막으로 나오는 위치부터 haystack 의 마지막까지의 haystack 문자열 부분을 반환합니다.
반환값이 없으면 false 리턴.
4. string strstr ( string $haystack , mixed $needle [, bool $before_needle ] )
needle 에서 haystack 이 처음 발견된 곳부터 끝까지의 부분 문자열을 반환합니다.
반환값 없으면 false 리턴.
5.string substr ( string $string , int $start [, int $length ] )
Returns the portion of string specified by the start and length parameters.
ex) substr("abcdef", -1); // returns "f"
substr("abcdef", 2, -1); // returns "cde"
substr('abcdef', 1); // bcdef
'HTML' 카테고리의 다른 글
★ php substr ★ asp right() 힘수 php로 만들기 (0) | 2011.05.10 |
---|---|
★ php substr ★ PHP 시간처리 (MySQL, time, substr, mktime) (0) | 2011.05.10 |
★ php substr ★ PHP 함수 substr() 사용법 (0) | 2011.05.10 |
★ php substr ★ [php] javascript unescape (0) | 2011.05.10 |
★ php substr ★ [PHP] 문자열 관련 함수 (0) | 2011.05.10 |