매우 단순한 preg replace로 바꿀 수는 있지만, 나는 옳다고 생각하지 않습니다.preg replace 키워드를 찾으십시오.
{this_is_a_key}
과 같은 키워드를 검색하고 다른 것으로 바꾸어야합니다.
$text = 'this is a sentence with a {this_is_a_key} in it';
echo preg_replace('/\{\w{1}\}/i','keyword',$text);
//output should be
//## "this is a sentence with a keyword in it" ##//
은 지금까지 나를 위해 작동하지 않습니다와 나는 ()
과 []
의 조합이지만
가능한 복제본 [정규식으로 바꾸는 방법을 알려 주실 수 있습니까?] (http://stackoverflow.com/questions/3372735/could-you-tell-how-to-replace-by-regular-expression) – Val