views:

54

answers:

2

I need to URLENCODE this:

<?php echo 'chart.php?api_url=http://0.chart.apis.google.com/chart?'.$chart1title.$chart1type.$chart1size.$chart1barsize.$chart1gridlines.$chart1data.$chart1color.$chart1bgcolor.$chart1visibleaxis.$chart1axislabels.$chart1axisdatascale.$chart1axisranges.'alt="answeredcalls"';?&gt;

And then decode it on the other side. How can I do this???

+4  A: 
'chart.php?api_url=' . urlencode('http://0.chart.apis.google.com/chart?'.$chart1title.$chart1type.$chart1size.$chart1barsize.$chart1gridlines.$chart1data.$chart1color.$chart1bgcolor.$chart1visibleaxis.$chart1axislabels.$chart1axisdatascale.$chart1axisranges.'alt="answeredcalls"');
nikic
A: 

Generally you won't have to use urldecode() when accessing $_GET parameters in PHP. It will be, essentially, decoded for you.

The previous answer is a good solution to the encoding part of the question.

Frederick