Php 将Large.jpg替换为t500x500.jpg
目前我正在使用SoundClouds API,我正在尝试使用以下代码制作艺术作品Php 将Large.jpg替换为t500x500.jpg,php,Php,目前我正在使用SoundClouds API,我正在尝试使用以下代码制作艺术作品 <div class="artwork_url"> <a href="'.$content[$x]['artwork_url'].'" style="text-decoration: none; color: #365899;">View Image</a> </div> 它将返回,但它返回的内容与此类似 任何帮助都将不胜感激。 这里有一个链接,只要你需要参考
<div class="artwork_url">
<a href="'.$content[$x]['artwork_url'].'" style="text-decoration: none; color: #365899;">View Image</a>
</div>
它将返回,但它返回的内容与此类似
任何帮助都将不胜感激。
这里有一个链接,只要你需要参考 根据文档
默认情况下,URL指向大的格式。如果要使用其他格式,则必须在图像URL中将large替换为特定格式名称:
这应该起作用:
PHP
str_replace('large', 't500x500', $content[$x]['artwork_url'])
HTML
<div class="artwork_url">
<a href="'.str_replace('large', 't500x500', $content[$x]['artwork_url']).'" style="text-decoration: none; color: #365899;">View Image</a>
</div>
根据文档
URL默认指向大的格式。如果要使用其他格式,则必须在图像URL中将large替换为特定格式名称:
这应该起作用:
PHP
str_replace('large', 't500x500', $content[$x]['artwork_url'])
HTML
<div class="artwork_url">
<a href="'.str_replace('large', 't500x500', $content[$x]['artwork_url']).'" style="text-decoration: none; color: #365899;">View Image</a>
</div>
你能做$content[$x]的var_dump()吗?$content[$x]['artwork\u url']
当前返回什么?你能不能不在图片url后添加维度你能做$content[$x]的var_dump()吗?$content[$x]['artwork\u url']
当前返回什么?你能不能不在图片url后添加维度我检查了文档,我认为替换large.jpg
或large.
应该更安全。甚至-large.
我检查了文档,我认为替换large.jpg
或large.
应该更安全。甚至-大。