e头在PHP中获取DOB或日期出生形式字符串

时间:2019-01-02 10:07:32

标签: php

我的字符串是

Personal Details :-Name: ABHISHEK DAS-Sex : Male-Date of Birth : 21st July 1986.-Marital status: Married-Nationality: Indian-Languages I can speak: Hindi, English, Bengali. -Declaration:-I here by declare that all the details furnished above are true to the best of my knowledge.-Date:9th November 2017 Abhishek Das----

我想从上面的字符串中获取生日:1986年7月21日

1 个答案:

答案 0 :(得分:1)

$str="
Personal Details :-Name: ABHISHEK DAS-Sex : Male-Date of Birth : 21st July 1986.-Marital status: Married-Nationality: Indian-Languages I can speak: Hindi, English, Bengali. -Declaration:-I here by declare that all the details furnished above are true to the best of my knowledge.-Date:9th November 2017 Abhishek Das----";

$date = trim(explode(".-",explode(":",$str)[4])[0]);