【问题标题】:CodeIgniter URLs - replacing ( with (CodeIgniter URL - 替换 ( 与 (
【发布时间】:2011-02-21 19:59:07
【问题描述】:

我正在编写从 URI 段创建图像文件的方法。问题是当我输入http://example.com/class/method/value1/value2/value ( 3 )/value4

而经过imagemagick处理后的图像是:

Value1
Value2
Value ( 3 )
Value4

我以这种方式获取数据:$this->data = addslashes(urldecode($data));

然后我手动将生成图像的代码更改为

$image->annotateImage($draw, 20, 20, 0, "value ( 3 )");

没关系。

【问题讨论】:

  • 您之前是否对文件名进行了 urlencoding 以便在 URL 中使用它?
  • 是的。使用w3schools.com/TAGS/ref_urlencode.asp手动替换所有特殊字符
  • 与 ( ) 或对应的 %28 %29 - > ( 的结果相同)

标签: php url codeigniter imagemagick special-characters


【解决方案1】:
html_entity_decode(urldecode($data));

为我完成了肮脏的工作。 :)

【讨论】:

    猜你喜欢
    • 2013-03-29
    • 2017-03-28
    • 2012-05-13
    • 2017-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-24
    相关资源
    最近更新 更多