Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("\n\nWelcome $this->first $this->last.");
- print("<hr />");
- //get the date
- $suffix = '';
- $date = $this->last_login_date;
- $year = substr($date,0,4);
- $month = substr($date,5,2);
- $day = substr($date,8,2);
- if($month == '01')
- {
- $month = 'January';
- }
- else if ($month == '02')
- {
- $month = 'Febuary';
- }
- else if ($month == '03')
- {
- $month = 'March';
- }
- else if ($month == '04')
- {
- $month = 'April';
- }
- //add more to convert numbers into months
- if ($day == '01' || $day == '21' || $day == '31')
- {
- $suffix = 'st';
- }
- else if ($day == '02' || $day == '22')
- {
- $suffix = 'nd';
- }
- else if ($day == '03' || $day == '23')
- {
- $suffix = 'rd';
- }
- else
- {
- $suffix = 'th';
- }
- echo 'Your last login was ' . $day . $suffix .' of ' . $month . ', ' . $year;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement