search

怎么用preg_replace
$content= "sdfggfhghjkjhkhljkljkljkadhkajdhkagfkhgkhgS?Hghjlfijsflkjaslfll
fgdfhsiodghoifgiosdg   p:/6117/civ/civ-issue/6117-mff.dgn   gjfdghfgdhd
p:/6117/civ/cov-issue/6117-mff.dgn   dfghdhfdgjgfjkgkhjkh........ "
要把$content中的所有绝对路径换成相对路径,如p:/6117/civ/civ-issue/6117-mff.dgn  
换为:6117-mff.dgn  
我想用preg_replace()做但没弄出来。

------解决方案--------------------
$content= "sdfggfhghjkjhkhljkljkljkadhkajdhkagfkhgkhgS?Hghjlfijsflkjaslfll
fgdfhsiodghoifgiosdg p:/6117/civ/civ-issue/6117-mff.dgn gjfdghfgdhd
p:/6117/civ/cov-issue/6117-mff.dgn dfghdhfdgjgfjkgkhjkh........ ";

echo preg_replace( "/[a-z]:\/\S+?\//iU ", " ", $content);

Statement
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
Linux中如何让所有用户登录时打印指定提示信息Linux中如何让所有用户登录时打印指定提示信息Feb 19, 2024 pm 05:12 PM

在Linux系统中,通过配置文件和脚本,可以实现让所有用户登录时显示指定的提示信息。接下来,我们将介绍几种常用的实现方法。方法一:修改/etc/issue文件打开终端,使用文本编辑器(如vi或nano)以root权限编辑/etc/issue文件。sudovi/etc/issue在文件末尾添加你想要显示的提示信息,例如:WelcometoMyLinuxSystem!Pleasebeawarethatallactivitiesaremonitored.保存并关闭文件。现在,当用户登录时,系统将显示/

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

Rivian upper control arm failures alarm owners - service centres seemingly to blameRivian upper control arm failures alarm owners - service centres seemingly to blameJun 25, 2024 pm 03:39 PM

As far as EV startups go, the Rivian R1T and its sister, the R1S, have been impressively unafflicted by major issues and recalls. A new report out of Carscoops, however, shines a light on a particularly annoying and frustrating issue Rivian R1T owner

CSS 内容属性详解:content、counter 和 quotesCSS 内容属性详解:content、counter 和 quotesOct 21, 2023 am 10:16 AM

CSS内容属性详解:content、counter和quotesCSS(层叠样式表)是前端开发中不可或缺的一部分,它可以帮助我们美化网页并增强用户体验。在CSS中,有一些特殊的属性可以用于控制文本内容的显示,其中包括content、counter和quotes。本文将详细介绍这些属性,并提供具体的代码示例。一、content属性content属性

Microsoft AI CEO says using open web content to train AI models isn\'t wrongMicrosoft AI CEO says using open web content to train AI models isn\'t wrongJun 30, 2024 pm 10:59 PM

In an interview with CNBC's Andrew Ross Sorkin, Microsoft AI CEO Mustafa Suleymanexpressed his understanding of web copyright law. Suleyman says that content that is accessible on the open web is "freeware," and anyone can copy it, reproduc

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没有关问题Jun 13, 2016 am 10:15 AM

不用数据库来实现用户的简单的下载,代码如下,但是却不能下载,请高手找下原因,文件路劲什么的没问题。<?phpfunction down_file($file_name,$file_sub_dir){//为防止乱码使用函数iconv$file_name=iconv("utf-8","gb2312",$file_

Rivian upper control arm failures cause alarm - service centres seemingly to blameRivian upper control arm failures cause alarm - service centres seemingly to blameJun 26, 2024 am 06:57 AM

As far as EV startups go, the Rivian R1T and its sister, the R1S, have been impressively unafflicted by major issues and recalls. A new report out of Carscoops, however, shines a light on a particularly annoying and frustrating issue Rivian R1T owner

为什么小弟我在php上写的这个代码,在浏览器上什么都不显示为什么小弟我在php上写的这个代码,在浏览器上什么都不显示Jun 13, 2016 am 10:24 AM

为什么我在php上写的这个代码,在浏览器上什么都不显示啊<?php   if(isset($_POST['Submit'])&& $_POST['Submit']=="登陆"){   $user=$_POST['user']; $pass=$_POST['pass']; if(empt

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),