Wrox Programmer Forums
|
BOOK: Beginning PHP 5.3
This is the forum to discuss the Wrox book Beginning PHP 5.3 by Matt Doyle; ISBN: 978-0-470-41396-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP 5.3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2010, 06:12 PM
Registered User
 
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Cool quadratic

I can't seem to solve the exercise at the end of Chapter 2 where we are asked to enhance the hello_with_time.php file. I get the correct time but no date.
Here is my php code:
<?php
// Get the current time in a readable format
$currentTime = date( "g:i:s a" );

// Get the current date in a readable format
$currentDate = date( "M j, Y" );

// Display greeting, time and date to the visitor
echo "Hello, world! The current time is $currentTime on $currentdate";
?>
I think I am going to enjoy the book and look forward to learning PHP!
 
Old March 25th, 2010, 09:03 PM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

In the last line of your code, $currentdate should be $currentDate. "D" should be capitalized.
 
Old March 25th, 2010, 09:44 PM
Registered User
 
Join Date: Mar 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default quadratic

Thank you so much PeterPeiGuo. Now for Chapter 3!





Similar Threads
Thread Thread Starter Forum Replies Last Post
MC++ quadratic equation problem Chrono251 VS.NET 2002/2003 0 December 18th, 2006 04:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.