在php中输出段落第一个句号后的所有内容

在php中输出段落第一个句号后的所有内容,php,html,strpos,Php,Html,Strpos,我在我的网站上有一个标题部分,它输出一篇新闻文章的标题和第一句话。下面我想输出文章的剩余部分减去第一段 像这样的东西会很棒: // Full Article $NewsArticle = "This is the article. I hope you like it."; // Find the First Full stop // Save everything after the first full stop to $NewsArticle $NewsArticle == "I

我在我的网站上有一个标题部分,它输出一篇新闻文章的标题和第一句话。下面我想输出文章的剩余部分减去第一段

像这样的东西会很棒:

// Full Article

$NewsArticle = "This is the article. I hope you like it.";

// Find the First Full stop

// Save everything after the first full stop to $NewsArticle 

$NewsArticle == "I hope you like it";
这方面的任何帮助都会很好

谢谢


Alex

只需使用substr函数

$str = "This is the article. Enjoy reading it. I hope you like it.";
$str_res = substr($str, strpos($str, ".")+1);
echo $str_res;  
试试这个

substr($NewsArticle, strpos($NewsArticle, ".")+1)

你试过什么了吗?如果你不需要最后一个句号,那就加号或者爆炸。是的,我一直在尝试strpos,但是运气不好。我想问一些有用的建议。嗨,谢谢你的回复-我真的应该更详细地说明我的问题,我需要它在第一个句号后输出所有内容,即使字符串的第二个索引包含句号,例如:$str=这是本文。喜欢读它。我希望你喜欢$str_res需要输出:享受阅读。我希望你喜欢。谢谢,为这个新手问题道歉。不客气。不用道歉,我们在某些方面是新手,更重要的是要不断学习,在有疑问的时候不要害怕提问。