分割字符串~

Jun 13, 2016 pm 01:34 PM
default gif head match user

分割字符串求助~~!!!
有这么一坨字符串:
/xxxx/zzzz/vvvv/bbbb/default_head/user1.gif
/video/templates/templates/images/default_head/user2.gif
......
/xxxx/zzzz/vvvv/bbbb/default_head/user14.gif

我需要得到user后面 和 “.” 前面的数字啊 (如1,2,14)

------解决方案--------------------

PHP code
<?php $str='/xxxx/zzzz/vvvv/bbbb/default_head/user14.gif';
preg_match('/(\d+)\.[^.]+/',$str,$match);
echo $match[1]; <div class="clear">
                 
              
              
        
            
Copy after login
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

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 ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between html5 tag head and header? What is the difference between html5 tag head and header? Jan 17, 2022 am 11:10 AM

Differences: 1. The head tag is used to define the head of the document, which is a container for all head elements, and the header tag is used to define the header (introduction information) of the document; 2. All browsers support the head tag, and older versions of browsers None of the browsers support the header tag, and browsers such as IE9+ and above are required to support the header tag.

Common application scenarios of the Head request method in Laravel Common application scenarios of the Head request method in Laravel Mar 06, 2024 pm 09:33 PM

Common application scenarios of the Head request method in Laravel In Laravel, the HEAD method in the HTTP request method is usually used to obtain the metadata of the resource without obtaining the actual content. The HEAD request is similar to the GET request, but does not return the actual response body content, only the response header information. This makes the HEAD request very useful in some specific scenarios. The following are some common application scenarios and corresponding code examples. Verify the validity of the link using the HEAD request method can be used to verify the chain

How to solve the problem of docker mounting directory permissions How to solve the problem of docker mounting directory permissions Feb 29, 2024 am 10:04 AM

In Docker, the permission problem of the mounting directory can usually be solved by the following method: adding permission-related options when using the -v parameter to specify the mounting directory. You can specify the permissions of the mounted directory by adding: ro or :rw after the mounted directory, indicating read-only and read-write permissions respectively. For example: dockerrun-v/host/path:/container/path:roimage_name Define the USER directive in the Dockerfile to specify the user running in the container to ensure that operations inside the container comply with permission requirements. For example: FROMimage_name#CreateanewuserRUNuseradd-ms/bin/

How to configure default gateway How to configure default gateway Dec 07, 2023 am 11:34 AM

Steps to configure default gateway: 1. Determine the IP address of the router; 2. Open the network configuration interface of the computer; 3. Configure network connection; 4. Configure IPv4 settings; 5. Enter the IP address and subnet mask; 6. Configure the default gateway ;7. Configure DNS server; 8. Save settings. Detailed introduction: 1. Determine the router's IP address. The default gateway address is usually the router's IP address. You can find the router's IP address on the back of the router or in the user manual; 2. Open the computer's network configuration, etc.

Configure default gateway Configure default gateway Dec 07, 2023 pm 03:02 PM

Steps to configure default gateway: 1. Open the control panel; 2. Select Network and Internet; 3. Configure network connection; 4. Configure IP address; 5. Configure DNS server address; 6. Confirm the configuration; 7. Restart the network device. Detailed introduction: 1. Open the Control Panel, in Windows system, click the Start menu, select "Control Panel"; 2. Select Network and Internet, in the Control Panel, select "Network and Internet"; 3. Configure network connections, etc. .

An in-depth analysis of the default usage of PHP: revealing its secrets for you An in-depth analysis of the default usage of PHP: revealing its secrets for you Mar 23, 2024 am 08:06 AM

PHP is a scripting language widely used in the field of web development. Developers have benefited a lot from its flexibility and powerful functions. In PHP, setting default values ​​is a common operation, and the default keyword plays a crucial role. This article will deeply analyze the usage of default in PHP, reveal its secrets for you, and combine it with specific code examples to help readers better understand. 1. Default parameter values ​​In PHP, we can set default values ​​for the parameters of a function to prevent

How to configure default gateway How to configure default gateway Dec 07, 2023 pm 02:56 PM

Steps to configure default gateway: 1. Understand the network environment; 2. Obtain the router IP address; 3. Log in to the router management interface; 4. Find and configure the WAN port settings; 5. Configure the default gateway; 6. Save the settings and exit; 7. Check whether the network connection is normal. Configuring the default gateway is an important step in network setup. It determines which router the host uses to access the Internet.

Does the Java keyword contain 'default'? Does the Java keyword contain 'default'? Apr 23, 2023 pm 01:13 PM

Is default a java keyword? Answer: default is a keyword in java8, also called "virtualextensionmethods". The Chinese translation is called "virtual extension method", which contains some default usage methods in the interface. When the interface is extended, it will not conflict with the implementation class code related to the interface. Introduction to default and java: 1. The previous interface was a double-edged sword, which could be oriented to abstraction but not oriented to specific programming. 2. The disadvantage of this is that when you need to modify the interface, you must first modify all classes that implement the interface. 3. When you cannot add new methods to the interface, it will not affect the existing display, so the default method is added to solve the problem for everyone.

See all articles