Solved

How do you format a dynamic variable in PHP?

Posted on 2008-06-24
4
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 143

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

691 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