PHP - GET variables with spaces

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

PHP - GET variables with spaces

Post 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 ?
nithinkk
Forum Commoner
Posts: 55
Joined: Sat Nov 28, 2009 7:57 am

Re: PHP - GET variables with spaces

Post by nithinkk »

Any way i got it :-)


$var=urlencode($var);
Post Reply