Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $months = array(1 => "January", 2 => "Febuary", 3 => "March", 4 => "April", 5 => "May", 6 => "June", 7 => "July", 8 => "August", 9 => "September", 10 => "October", 11 => "November", 12 => "December",);
- $string = '16/12/2011';
- $str = explode('/', $string);
- $day = $str[0];
- $mon = $months[intval($str[1])];
- $year = $str[2];
- $fixed_date = "$day $mon $year";
- $fixed_time = strtotime($fixed_date);
- if(!$fixed_time){
- echo "Not going to work";
- }else{
- echo $fixed_time;
- }
- //Also, Nick's an idiot. :P
- ?>
Advertisement
Add Comment
Please, Sign In to add comment