here's my question:
i have the folwing code in my project:
$news = "Article 20.part2";
if(strpos($news,'.part1')) {$news_n = ".part1";}
else if(strpos($news,'.part2')) {$news_n = ".part2";}
else if(strpos($news,'.part3')) {$news_n = ".part3";}
else if(strpos($news,'.part4')) {$news_n = ".part4";}
else if(strpos($news,'.part5')) {$news_n = ".part5";}
echo $news;
echo "Part number:" . $news_n . "- <a href=\"#\">Read more</a>";
What i want is to display the number of the news part, but the problem is that there are articles with +20/+30 parts and i don't want to add
else if(strpos($news,'.part20')) {$news_n = ".part20";}
etc to my code.
Is there any easier way to do this?
Thanks in advance for your help!