简体   繁体   中英

Set image size from from rss feed

I have a rss feed where the image size is not set, like the image shows like ---

**hello.tv/imagecache/{size}/cloud/content-images**

So here if I replace it by 300x400 than it comes the image. So now how can I change the image size from rss feed before it saves in the database.

I am working on php.

If you just need to replace {size} with the string '300x400' you could use something as simple as PHP's built in str_replace function.

$str = '**hello.tv/imagecache/{size}/cloud/content-images**'
$replacedStr = str_replace('{size}', '300x400', $str);

http://php.net/str_replace

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM