함수 substrAfter()

Jmnote (토론 | 기여)님의 2022년 5월 19일 (목) 14:10 판 (Jmnote님이 함수 substr after() 문서를 함수 substrAfter() 문서로 이동했습니다)


1 Bash

str='hello world'
echo ${str#*ll}
# o world
echo ${str#*l}
# lo world
echo ${str#*x}
# hello world

2 PHP

function substr_after($needle, $haystack) { return substr( strchr($haystack,$needle), strlen($needle) ); }

echo substr_after('ll', 'hello world');
echo substr_after('l', 'hello world');
echo substr_after('x', 'hello world'); // bool(false)
# o world
# lo world
#

3 같이 보기

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