Display year an individual was born : explode « Data Structure « PHP

Display year an individual was born


$expdate = explode ("-","1979-06-23"); 
echo $expdate[0] . ",";
echo $expdate[0]; 

Related examples in the same category

1.Breaking Strings into Arrays with explode()
2.Using the explode() Function
3.Generating an ID with microtime()
4.explode( ) function converts a string into an array using a separator value
5.explode() function divides string into various elements, returning these elements in an array.
7.Using explode() with date()
8.Processing variable-length text fields
9.Reading and Writing Comma-Separated Data