Log In
Sign Up
Why Join Hot Scripts?
Hot Scripts
All Categories
PHP
Python
Tools & Utilities
XML
Ruby on Rails
Ajax
Web Hosting
ASP
ASP.NET
C & C++
CFML
Flash
Java
JavaScript
CGI & Perl
HTML5
Forums
Blog
Scripts
Hosted Apps
Plugins
Design Templates
Forum
Blog
Advertise
Contact Us
Register
FAQ
Rules
Calendar
Search
Today's Posts
Mark Forums Read
RSS Feeds
Current location:
Hot Scripts Forums
»
Programming Languages
»
PHP
» PHP Function to find if a variable is a valid date?
PHP Function to find if a variable is a valid date?
LinkBack
Thread Tools
Display Modes
#
1
(
permalink
)
11-01-04, 09:56 PM
jozin
Newbie Coder
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Function to find if a variable is a valid date?
Hello to everyone,
Is there a built-in function in PHP to validate if the entered value is a valid date? Like, is_number()?
Thanks a lot in advance.
jozin
jozin
View Public Profile
Find all posts by jozin
#
2
(
permalink
)
11-01-04, 10:12 PM
moronovich
Junior Code Guru
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
simply use (bool) checkdate($givenMonth,$givenDay,$givenYear)
it's all that you need.
regards,
__________________
just an ignorant noob with moronic solution...
moronovich
View Public Profile
Find all posts by moronovich
#
3
(
permalink
)
11-01-04, 10:55 PM
4n7hr4x
Banned
Join Date: Jun 2004
Posts: 237
Thanks: 0
Thanked 0 Times in 0 Posts
you can always do is_numerical($date){ but the above method is better for a more specific checking
4n7hr4x
View Public Profile
Find all posts by 4n7hr4x
#
4
(
permalink
)
11-06-04, 01:51 AM
jozin
Newbie Coder
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks
Hi guys,
Thanks for the info. I wonder why PHP didn't make a built-in function for it(like isDate() in VB).
More power.
jozin
jozin
View Public Profile
Find all posts by jozin
#
5
(
permalink
)
11-07-04, 02:03 AM
moronovich
Junior Code Guru
Join Date: Oct 2004
Posts: 460
Thanks: 0
Thanked 0 Times in 0 Posts
i feel the internals will reply like this: it's more like user issue rather than php issue. anyway, this suggestion is ok. i'll try to forward it.
regards,
__________________
just an ignorant noob with moronic solution...
moronovich
View Public Profile
Find all posts by moronovich
Bookmarks
Digg
del.icio.us
StumbleUpon
Google
«
Only the first word is displayed in the form when editing.
|
Product Registration Form
»
Currently Active Users Viewing This Thread: 1
(0 members and 1 guests)
Thread Tools
Show Printable Version
Email this Page
Display Modes
Linear Mode
Switch to Hybrid Mode
Switch to Threaded Mode
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
Off
HTML code is
Off
Trackbacks
are
On
Pingbacks
are
On
Refbacks
are
On
Forum Rules
Forum Jump
User Control Panel
Private Messages
Subscriptions
Who's Online
Search Forums
Forums Home
General Community
Announcements
Polls
The Lounge
New Members & Introductions
Script Requests
HotScripts.com Discussion
Hot Scripts Forum Questions, Suggestions and Feedback
General HotScripts Site Discussion
HotScripts Site Bug Reports
General Web Coding
HTML/XHTML/XML
HTML5
JavaScript
CSS
Flash & ActionScript
Programming Languages
PHP
Perl
ASP
ASP.NET
C/C++
Visual Basic
Windows .NET Programming
Everything Java
Other Languages
Other Discussions
Web Servers
Database
Other Topics
Web Design
API
Frameworks
AJAX
Security
Server Administration
Portable Device Programming
Cloud Computing
Ruby on Rails
CFML
Python
Tools and Utilities
Remotely Hosted
Web Hosting
Advertising Forums
General Advertisements
Job Offers & Assistance
Traffic Exchange
Website Reviews
Web Hosting Talk
DBForums.com
Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
PHP Error
Fairnie
PHP
8
06-26-04
07:15 AM
Disable form fields to be submitted
RickyRod
JavaScript
2
05-24-04
10:15 AM
accessing existing ISP email with a PHP webmail script.
nlancaster
PHP
1
01-07-04
03:28 AM
Help trim code down
TheLaughingBandit
JavaScript
0
09-02-03
09:50 AM
edit php in Squirrelmail
jrcortrightiii
PHP
1
07-10-03
02:08 PM
All times are GMT -5. The time now is
04:42 AM
.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
LinkBack
LinkBack URL
About LinkBacks
Bookmark & Share
Digg this Thread!
Add Thread to del.icio.us
Bookmark in Technorati
Share on Facebook
Share on Stumble Upon
Share on Twitter