I have a search form in my page where a user submits a query. The form is submitted and the search query is submitted in the browser's url. The PHP searches and return the result. E.g. http://example.com/search-results.php?q=ABC+books
The result page has its own independant search form which includes the text box. I use $_GET['q'] to get the text in the input box which displays ABC books
.
The problem is when I use search queries that contain characters like an apostrophe ('). E.g. when I search Marley's Bar the URL would be - http://example.com/search-results.php?q= marley%27s+bar The outputted text in the input box displays marley\'s bar I would like to return the value as 'marley's bar' without the slash.
I tried
$getSearchQuery = $_GET['q'];
$getSearchQuery = rawurldecode($getSearchQuery);
but the output is still the same.