怎么利用preg_replace将images文件夹前的目录删除,文件夹images前面和后面目录都是动态的。
例如 19de091dcb8bfdca40f36d2de7abd81a
f93b82cc7fca9eaf449e66baf25e8be9
a7df644af73682a3f286de39e3fd25b2
你不会再说连 images 也是不确定的了吧?
$s =<<< TXT<img src="www.abc/n1/n2/images/abc.jpg"><img src="images/abc.jpg"><img src="www.abc/n1/images/www/abc.jpg">TXT;echo preg_replace('#(?<=").+/(images/[^"]+)#', '$1', $s);f93b82cc7fca9eaf449e66baf25e8be9
你不会再说连 images 也是不确定的了吧?
$s =<<< TXT<img src="www.abc/n1/n2/images/abc.jpg"><img src="images/abc.jpg"><img src="www.abc/n1/images/www/abc.jpg">TXT;echo preg_replace('#(?<=").+/(images/[^"]+)#', '$1', $s);f93b82cc7fca9eaf449e66baf25e8be9