php - 如何使用变量对 URL 进行 URLENCODE?

标签 php urlencode urldecode

我需要对此进行 URLENCODE:

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

然后在另一边解码。我该怎么做???

最佳答案

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

关于php - 如何使用变量对 URL 进行 URLENCODE?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3540496/

相关文章:

php - ajax通过传递参数加载外部文件

PHP CodeIgniter-combobox 值未在数据库中更新

java - php urlencode 和 java urlencode 一样吗?

python - 在 Python 中解码 Microsoft Safelink URL

php - PHP 会自动对 $_POST 执行 urldecode() 吗?

php - Web 服务器和 Servlet 容器之间的区别

php - MySQL & 代码点火器 3 : Error too many connection

php - Android 中的 rawurlencode 等价物

asp.net-mvc - Href ASP.NET MVC/Razor 的 URL 编码字符串

ios - swift removingPercentEncoding 不适用于 gb2312 字符串