Ask for advice on replacing the first part of the image address with php regular rules

WBOY
Release: 2016-10-24 00:12:43
Original
1114 people have browsed it

How to use PHP regular to replace the image address http://img04.taobaocdn.com/ba...!!0-item_pic.jpg_230x230.jpg with https://img.alicdn.com/bao/up...!! 0-item_pic.jpg_230x230.jpg

img04 The 04 number behind it will change

That is, replace http://img0*.taobaocdn.com/ with https://img.alicdn.com/

I tried some methods, but either all of them were replaced or they couldn’t be replaced normally

Reply content:

How to use PHP regular to replace the image address http://img04.taobaocdn.com/ba...!!0-item_pic.jpg_230x230.jpg with https://img.alicdn.com/bao/up...!! 0-item_pic.jpg_230x230.jpg

img04 The 04 number behind it will change

That is, replace http://img0*.taobaocdn.com/ with https://img.alicdn.com/

I tried some methods, but either I replaced them all or it couldn’t be replaced normally

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template