What I am looking for by using preg_replace is replacing ". or ' or space" from string with "-".
Like replacing "Some St. Street O' Corner"
into "some-st-street-o-corner"
.
How i am achieving this is by using below way.
$string = "Some St. Street O' Corner";
$new_string = preg_replace('/\\.|\\'/', '', $string);
$final_string = str_replace(' ', '-', $new_string);
Is there any better way to get it done by just using preg_replace?