Solved

How do you format a dynamic variable in PHP?

Posted on 2008-06-24
4
195 Views
Last Modified: 2013-12-12
I am trying to format a dynamic variable from my SQL query. How do I do that? My variable is.

$event_result['start_date']
0
Comment
Question by:kallestie
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21860443
format how?
0
 
LVL 14

Accepted Solution

by:
Vel Eous earned 500 total points
ID: 21860467
You mean date format?

echo date ( 'Y-m-d', mktime ( $event_result['start_date'] ) );
0
 
LVL 24

Expert Comment

by:glcummins
ID: 21860468
You can use the PHP date() function to format dates. For more information, please see http://www.php.net/date and http://www.php.net/strtotime .
0
 
LVL 2

Author Closing Comment

by:kallestie
ID: 31470377
Thank you!!! :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress Taxonomy 2 27
hasing a url 16 24
showing loader for php/mysql/ajax live search 13 23
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 31
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question