0
"*"문자가 거의 들어 있지 않은 긴 문자열이 있습니다. 그 문자를 모두 찾아서 그 뒤에 8 개의 문자를 넣고 싶습니다. 그리고 다른 문자로 바꾸십시오. 이 작업을 수행하는 가장 좋은 방법은 무엇입니까? 이것은 내가하려고 노력하는 방법이다 : 당신이 가고 싶은 곳php 특정 문자 다음에 오는 문자열 찾기 및 바꾸기
$over_string=strlen($story)-1;
for ($i=0; $i<$over_string; $i++){
if($story[$i]=='*'){
$id_substr=substr($story, $i+1,8);
$name_player_change=some_function($id_substr);
$id_to_replace='*'.$id_substr;
$name_to_place='<a href="#">'.$name_player_change.'</a>';
$story=str_replace($id_to_replace,$name_to_place,$story);
}//if
}//for
원본 문자열의 모양을 게시 할 수 있습니까? –