分割字符串~
分割字符串求助~~!!!
有这么一坨字符串:
/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">

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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 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

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/

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.

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. .

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

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.

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.
