함수 substr from()

Jmnote (토론 | 기여)님의 2015년 2월 20일 (금) 17:11 판
substr_from
strstr

1 PHP

echo strstr('hello world', 'll');
echo strstr('hello world', 'l');
echo strstr('hello world', 'x'); // bool(false)
# llo world
# llo world
#
function substr_from($needle, $haystack) { return strstr($haystack, $needle); }

echo substr_from('ll', 'hello world');
echo substr_from('l', 'hello world');
echo substr_from('x', 'hello world'); // bool(false)
# llo world
# llo world
#

2 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}