4

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"';?>

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

user342391
  • 7,569
  • 23
  • 66
  • 88

2 Answers2

6
'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
  • 100,734
  • 37
  • 191
  • 225
0

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
  • 46
  • 2