我用PHP版Pinterest的引脚It按钮的工作和我正在与该URL的“说明”部分的问题...PHP与网址友好的文本替换包括hashtag
我使用PHP生成的网址:
$pinurl = 'http://foo.com';
$pinmedia = 'http://foo.com/picture.jpg';
$pindesc = 'my description with #hashtag';
$pin = 'http://pinterest.com/pin/create/button/?url='.$pinurl.'&media='.$pinmedia.'&description='.$pindesc.'';
echo '<a href="'.$pin.'" class="pin-it-button" count-layout="none" target="_blank">Pin It!</a>';
我碰上是当我的$ pindesc变量中有一个主题标签或仅一个主题标签,Pinterest的不从URL因为它看起来像读它的问题:
http://pinterest.com/pin/create/button/?url=http://foo.com&media=http://foo.com/foo.jpg&description=#foo
显然,#foo并没有被当作描述来读取......
我想知道是否有某种解决方法,或者如果我可以使用“if”语句来运行我的$ pindesc变量来检查并用“%url”替换#标签,这是“url友好型”
谢谢!
正是我在找的!非常感谢! – tcd