Reputation: 3
$html.='<td><a href="'.get_bloginfo('home_url()').'/search/'.'&submit=Search">'.urlencode($result->terms).htmlspecialchars($result->terms).'</a></td>';
I've tried urlencode, urldecode, rawurlencode and rawurldecode. I quite obviously have no idea what I am doing and have spent the last few hours going in circles trying to learn this stuff.
I have a list of search terms prefixed with a hashtag but when clicked, return no results. When '#' is replaced with '%23' in the address bar, the search works.
Is there an easy fix or do I take up flower arranging as a hobby?
Upvotes: 0
Views: 1376
Reputation: 5438
Can always just use str_replace()
: http://php.net/manual/en/function.str-replace.php
So if your parameters are in $result->terms
then just do
str_replace('#', '%23', $result->terms);
Upvotes: 1