Page 1 of 1

PHP - GET variables with spaces

Posted: Thu Nov 17, 2011 12:15 am
by nithinkk
i have to pass a php get variable with spaces! can any one suggest how to do it ?

Variable = Nithin kk

$var="nithin kk";

Code: Select all

  href=http://example.com/view.php?name=$var;> 

i am not able to get "kk" the get variable only takes the value before the space. Can any one suggest how to solve this problem ?

Re: PHP - GET variables with spaces

Posted: Thu Nov 17, 2011 12:22 am
by nithinkk
Any way i got it :-)


$var=urlencode($var);