I am trying to get "content" from this line:
$string = "start start content end";
with preg_match like this:
preg_match('/start(.*?)end/', $string, $matches);
echo $match[1];
but the problem $matches[1]
returns start content
not only content
because there are two start
in $string
(and possibly more)
How to get only content
part with preg_match
?
source
share