Php+mysql take video table information. How to Match intercept name

Source: Internet
Author: User
Php+mysql take video table information. How to Match intercept name
Php+mysql Database Video table fetching video information video_list
There are fields Video_name as follows:
Data 1 "Hundred-house Pulpit" 20111220
Data 2 "Hundred House Pulpit" 20111214 contacts reads "The historical records"--Qin Shi Huang (30) Life and death boundless
If it is data 1 direct fetch video_name, output
If this is the character output after the data 2 intercept time
8-bit date numbers have a space character around them.
How do I determine the 2 types in the loop and intercept them? How do you write it with a regular?

------Solution--------------------
$t = Preg_split ('/\s+\d+\s+/', $roe [' Video_name '], preg_split_no_empty);
Echo End ($t);

------Solution--------------------
Oh, one less parameter.
$t = Preg_split ('/\s+\d+\s+/', $roe [' Video_name '],-1, preg_split_no_empty);
------Solution--------------------
$roe [' video_name ']= ' hundred House pulpit 20111214 contacts read "Shiji"--Qin Shihuang (30) The boundless life and death ";
$chars = Preg_split ('/[0-9]/', $roe [' Video_name '], -1,preg_split_no_empty);
$rs = (count ($chars) >1)? $chars [1]: $roe [' video_name '];
Echo $rs;
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.