Alexander  Capone
Alexander Capone

Reputation: 548

yii framework for php $this->redirect() function

yii framework for php $this->redirect() function works great, it can redirect to external links, but when I useæ, ø, å characters in string, they are wrongly shown in the final url after redirect.

$this->redirect ("http://test.com?name=børing");

will redirect me to a page

test.com?name=børing

Help me to fix this issue

Upvotes: 0

Views: 189

Answers (2)

Alexander  Capone
Alexander Capone

Reputation: 548

So, i combined @zazu suggestion and first answer and this:

urlencode(utf8_decode($url));

Worked for me.

Upvotes: 0

Let me see
Let me see

Reputation: 5094

try this

$this->redirect("http://test.com?name=" . urlencode("børing"));

Upvotes: 1

Related Questions