By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

Extracting day and month from a date string in PHP

P: 1
This is my first page

Expand|Select|Wrap|Line Numbers
  1. <form name="form1" method="post" action="ins_comp.php" onsubmit="return form_chk();">
  2.  
[Please use CODE tags when posting source code. Thanks! --pbmods]

this is next page where i'm printing the posted values

Expand|Select|Wrap|Line Numbers
  1. echo '<pre>';
  2. print_r($_POST);
  3.  
its displaying


Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3.     [sys_id] => Dbms0001
  4.     [domain] => Discnet
  5.     [User] => prashanth
  6.     [emp_code] => Dt0125
  7.     [os] => WINDOWS XP
  8.     [ip_addr] => 192.168.10.31
  9.     [date_ins] => 24-05-2007
  10.     [months] => 4
  11.     [years] => 2007
  12. )
  13.  
the thing i do want to print months and years ... please help anyone....
May 24 '07 #1
Share this Question
Share on Google+
1 Reply


pbmods
Expert 5K+
P: 5,821
Changed thread title to better match contents.

---------------

Heya, prashanth23in. Welcome to TSDN!

Take a look at the date and strtotime functions. They should do just about exactly what you're looking for.
May 24 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.