Solved

How do you format a dynamic variable in PHP?

Posted on 2008-06-24
4
193 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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

20 Experts available now in Live!

Get 1:1 Help Now