i have a string
$str = "this is [start] my string [end] at this moment";
i need to get the content within [start]
and [end]
.
when i use
$result = preg_match('/\[start\].+\[end\]/',$str, $m);
it mutches [start] my string [end]
, but i need to get only my string
(without spaces).
sure i can make another preg_replace and delete them, but i think there must be more elegant solution.
Thanks