I have the following regular expression which is stripping all unwanted characters before sending a variable to a url.
$url = preg_replace('~[^\\pL0-9_]+~u', '_', $url);
The problem is I would like to keep single quotation marks or encode them for the url so that I may retrieve them on the next page. The function above is currently getting rid of all single quotes.
I hacked this together and am not sure how to do this. Please Help!
Aaron
$url = preg_replace('~[^\\pL0-9_]+~u', '_', $url);
The problem is I would like to keep single quotation marks or encode them for the url so that I may retrieve them on the next page. The function above is currently getting rid of all single quotes.
I hacked this together and am not sure how to do this. Please Help!
Aaron
Comment