いくつかの文字列が$text="Here are some text. The word is inside of the second sentence.";
あり、$word="word";
取得方法$sentence="The word is inside of the second sentence";
- を含む最初の文" ".$word." "
もちろん、いくつかの仮定を立てる必要があります。その一つは、すべての文が".\r\n"
or "!\r\n"
or ". "
orで終わること"! "
です。
PS 私たちは確信していますstrpos($text," ".$word." ")!==false