I am getting data from a different server and in that there a string (title) of a post which is also being passed to my server . i am trying to filter out the unwanted spaces and characters but it does not seems to work . The code i made is
$find = array("%"," ","&","%20");
$replace = array("-");
$post_filtered_name=strtolower(str_replace($find,$replace,$post_title));
But i get the result
benten
instead of that i should get
ben-ten