I want to ask about is it possible to get some string that between a specifi keyword? For example, I have 2 sentence like these:
I will go to #new bathroom and wash the car#
Result: bathroom and wash the car
Someone need an #new icebreaker# to hold that problem
Result : icebreaker
I want to make condition to get all words between the #new #
Any idea how to create this?
My code so far:
<?php
$sentence = "I will go to #new bathroom and wash the car#";
$start = strpos($sentence, "#new");
//$end = strpos($sentence, "#");
$end = 20; //because my strpos still wrong, I define a static number
$new = substr($sentence, $start, $end);
echo $new;
?>
My problem is I can't find a way to chase the last hashtag