I have this input string: '- - Adele Gislan - Web Developer - - - '
and the expected output is this string: Adele Gislan - Web Developer
I use this regular expression
$urli='- - Adele Gislan - Web Developer - - - ';
$urli = preg_replace("/\-[[:space:]]+$/","",$urli);
$urli = preg_replace("/\-+$/","",$urli);
But this remove special character "-" or "- " only one time.
I try this
$urli = rtrim($urli, '-');
$urli = ltrim($urli, '-');
but isnt ideal