php+mysql 取视频表信息。怎么匹配截取name
php+mysql 取视频表信息。如何匹配截取name
php+mysql 数据库视频表 取视频信息 video_list
其中有字段video_name 如下:
数据1《百家讲坛》20111220
数据2《百家讲坛》20111214 王立群读《史记》――秦始皇(三十)生死茫茫
如果是数据1 直接取video_name,输出
如果是数据2 截取时间后面的字符输出
8位日期数字的左右都有一个空格符。
请问我该如何在循环中判断这2中类型并截取呢?是用正则么,该怎嘛写啊
------解决方案--------------------
$t = preg_split('/\s+\d+\s+/', $roe['video_name'], PREG_SPLIT_NO_EMPTY);
echo end($t);
------解决方案--------------------
哦,少了一个参数
$t = preg_split('/\s+\d+\s+/', $roe['video_name'],-1, PREG_SPLIT_NO_EMPTY);
------解决方案--------------------
$roe['video_name']= '《百家讲坛》20111214 王立群读《史记》――秦始皇(三十)生死茫茫';
$chars = preg_split('/[0-9]/', $roe['video_name'], -1,PREG_SPLIT_NO_EMPTY );
$rs= (count($chars)>1) ? $chars[1] : $roe['video_name'];
echo $rs;

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

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











Click to enter: ChatGPT Tool Plug-in Navigation Collection Some users complained that their computers frequently crashed with the stop code VIDEO DXGKRNL FATAL ERROR. This particular issue occurs only occasionally and has a bugcheck value of 0x00000113, which indicates a violation in the Microsoft DirectX graphics kernel subsystem, as indicated by the bugcheck value. Usually, the error occurs when a corrupt driver interferes with the normal operation of the graphics card's graphics processor. If you're currently struggling with this specific issue, our article will provide you with a variety of high-quality troubleshooting tips. Below you'll find various methods that other users who encountered the exact same error have used successfully. yes

Over the past few weeks, the most important specifications and the euro prices of the Motorola Razr 50 and the Razr 50 Ultra have been leaked. Now the enormously reliable leaker @MysteryLupin was able to publish the teaser video embedded below, which

The Google Pixel 9 Pro and Pro XL are Google's answers to the likes of the Samsung Galaxy S24 Ultra and the Apple iPhone 15 Pro and Pro Max. Daniel Sin on YouTube(watch below) has compared the Google Pixel 9 Pro XL to the iPhone 15 Pro Max with some

Despite the hype surrounding the Qualcomm Snapdragon X Elite, it has been a rather mediocre launch. In our review, we found that the most impressive part of the new Qualcomm Snapdragon X Elite X1E-78-100-powered Asus Vivobook S 15 was the seamlessnes

Sinceitslaunchearlierthisyear,thePanasonicLumixS9hasbeenembroiledincontroversy.BetweenthecornersPanasoniccuttoarriveatsuchasmallbodyandthefusscertaincamerareviewerskickeduponYouTube,itseemedliketheLumixS9wasdoom

Detailed explanation of the video tag in HTML The video tag in HTML5 is a tag used to play videos on web pages. It can render videos using different formats, such as MP4, WebM, Ogg, and more. In this article, we will introduce the use of video tag in detail and provide specific code examples. Basic Structure The following is the basic structure of the video tag:

In the Go language, the bytes package is a package for manipulating byte types, and it contains many useful methods, such as the Split() method. However, when using the Split() method, you may encounter an "undefined: bytes.Split" error. This error is usually caused by incompatible Go versions or lack of necessary dependent libraries. This article will introduce some methods to solve this error. Method 1: Upgrade the Go version as follows

In the Go language, the Split() method is used to split a string. You can use delimiters to divide the string into a list of substrings, and the substrings are returned in the form of slices. Split() is a method of the strings package. You need to import the strings package before using it. The syntax is "strings.Split (string to be split, delimiter)".
