July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.
<?php $file = "aaaaaaaaaa20090329aaaa"; $file_date = substr($file, 10, -4); //get the date from the file name $file_year = substr($file_date, 0, -4); //get the year from the file date $file_month = substr($file_date, 4, -2); //get the month from the file date $file_day = substr($file_date, 6); //get the day (numeric) of the file $constructed_date = "$file_month/$file_day/$file_year"; print($constructed_date); ?>
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.