带有特殊字符的PHP脚本网址

我在wordpress页面中有此PHP代码

$str = 's.aspx?sm=Q830I7SJZvuSP3HzDfFlVA%3d%3d';

printf('<a href="https://www.surveymonkey.com/.urlencode($str)." target="_blank">
            <img src="http://www.anyfood.gr/net/wp-content/uploads/2014/12/evaluation2.jpg" style="padding:20px;">
       </a>'
);

但是链接无效,我已经尝试过使用单引号等几种技巧.
但我不知道…有什么想法吗?

解决方法:

试试这个,对我有用:

<?PHP
$str = 's.aspx?sm=Q830I7SJZvuSP3HzDfFlVA%3d%3d';

printf('<a href="https://www.surveymonkey.com/%1$s " target="_blank"> <img src="http://www.anyfood.gr/net/wp-content/uploads/2014/12/evaluation2.jpg" style="padding:20px;"> </a>', urlencode($str));
?>

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...