Reputation: 83
I am trying to google a solution for parsing a PHP variable "Joe Soap" into a html header I am expecting: http://myurl.com&name=joe soap but I am getting http://myurl.com&name=joe
I know I can not have spaces in my http header but I can't find out how to parse my variable. I just need a hint so that I can google it. Regards
Upvotes: 0
Views: 37
Reputation: 432
Without some code it's guessing work.
I think you need PHP urlencode
$test = 'Joe Soap';
echo 'http://example.com/?name=' . urlencode ( $test );
Which results in: http://example.com/?name=Joe+Soap
Upvotes: 2
Reputation: 83
2 minutes after I ask the question, I find the answer. use the urlencode function in php regards
Upvotes: 0