Solved

How do you format a dynamic variable in PHP?

Posted on 2008-06-24
4
194 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:
Tchuki 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

948 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now