How can I get the string that is placed within two star symbols – * – like StackOverflow here?
For instance,
$string_1 = 'this is the *string I want to display only*';
or
$string_2 = 'this is the * string I want to display only *';
note that there are spaces on the second string.
I want to return this only,
string I want to display only
Using regex is what I can think of… any ideas?
Try this