?代碼如下 | 復制代碼 |
function matchdomain($q){ preg_match('/(([a-z0-9](w|-){0,61}?[a-z0-9]|[a-z0-9]).){1,}(aero|arpa|asia|biz|cat|com|coop|co|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z][a-z])(.[a-z][a-z]){0,1}/', $q, $matches); return $matches[0]; } |
//實例應用
?代碼如下 | 復制代碼 |
$com = 'www.111cn.net'; echo matchdomain($com); //www.111cn.net $cn = 'afdsafs'; echo matchdomain($cn); |
//notice: undefined offset: 0 因為沒有不是域名所以正則不到域名所以出錯了。

Hot AI Tools

Undress AI Tool
Undress images for free

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

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

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

The difference between comcn and com: 1. There are differences between comcn and com in terms of meaning, but there is no difference in access speed; 2. comcn is an international domain name and is a global top-level domain name for use by commercial institutions, while cn is a Chinese company domain name , domestic commercial institutions, domestic domain names, only enterprises can register; 3. The search priority is that cn will search for .cn first. After finding the .cn server, the .cn server will then search for .com; 4. cn is provided by cnnic China Internet Center Management, com's management organization is abroad.

Huawei has now started selling the Watch GT 5, which has debuted globally alongside the Watch GT 5 Pro and the Watch D2. Added to that, Huawei has also showcased the MatePad Pro 12.2 and MatePad 12 X today outside China, details of which we have cove

If you encounter the .NET Framework error 0x800713ec when installing a program in Windows 11/10, there are some methods you can take to solve the problem. This error is usually caused by not having the correct .NET Framework version, but there can be other causes. Here, we explore some common root causes to help you identify your issue and resolve it as quickly as possible. The entire error message looks like this: One or more issues caused the installation to fail. Please resolve the issue and try the installation again. See the log file for details. 0x800713ec Fix 0x800713ec.NET Framework Error Code To fix 0x800713ec.NET Framework error code, follow the solutions below

With the launch of .NETCore, .NET developers have a new opportunity to easily write and run .NET applications on multiple operating systems. This article will delve into how to use .NETCore to achieve cross-platform application development, and share best practice experience on operating systems such as Windows, Linux, and macOS. 1. Prepare the development environment. To start cross-platform application development, you first need to prepare the development environment for each target platform. Windows On Windows, you can install .NETCoreSDK through Visual Studio. After installation is complete, you can create and run .NETCore projects through Visual Studio. Li

How to uninstall .netframework in Win10 system? Recently, some users have had some problems with their computers. They need to reinstall .netframework, but they need to uninstall the original files first. The user does not know how to uninstall. In fact, it is the same as the uninstaller. Next, the editor will introduce the method of uninstalling .netframework. Bar. Uninstallation steps 1. Enter the "Control Panel" interface and click on the "Programs" option. 2. Then click the “Uninstall a program” option in “Programs and Features”. 3. In the opened window interface, find “.netfr

PHP is a powerful programming language that is widely used in the development of web applications and desktop applications. However, when using PHP, you may encounter some errors and exceptions. This article will focus on the solution to "PHPFatalerror: Class'COM'notfound". Positioning Problem First, we need to understand the source of the error and the positioning problem. This error usually means that you are trying to use a COM extension in your code, but when loading the parser

Javaisahigh-levelprogramminglanguageoriginallydevelopedbySunMicrosystemsandreleasedin1995.Javarunsonavarietyofplatforms,suchasWindows,MacOS,andthevariousversionsofUNIX..NETframeworkisacomputersoftwareframeworkinventedbyMicrosoft.ItrunsonMicrosoftWind
