| | |
date variable plus 1 error(pls help)
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
good day.!
I want this date format to be echo. 2009-2010. My code gots error when i try to show this format. Here is my code:
Thank you for giving time this simple problem.
God bless on this mother earth.
I want this date format to be echo. 2009-2010. My code gots error when i try to show this format. Here is my code:
php Syntax (Toggle Plain Text)
$nowdate = date('Y') "-" date('Y') + 1; echo $nowdate;
Thank you for giving time this simple problem.
God bless on this mother earth.
Last edited by blocker; Mar 23rd, 2009 at 1:43 am.
I assume you want $nowdate to be a string. String concatenation in PHP uses a period character to join strings. This **should** work:
php Syntax (Toggle Plain Text)
$nowdate = date('Y') . "-" . (date('Y') + 1);
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. This may not be the best way to do it, but it should work
I really need to go to sleep
php Syntax (Toggle Plain Text)
$thisYear = date('Y'); $nextYear = $thisYear + 1 $nowdate = $thisYear "-" $nextYear;
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
•
•
This may not be the best way to do it, but it should work
I really need to go to sleepphp Syntax (Toggle Plain Text)
$thisYear = date('Y'); $nextYear = $thisYear + 1 $nowdate = $thisYear "-" $nextYear;
php Syntax (Toggle Plain Text)
$thisYear = date('Y'); $nextYear = $thisYear + 1; $nowdate = $thisYear ."-". $nextYear; echo $nowdate;
Thank many very much.
The first reply shows nothing on the browser but I use his technique to concantinate the string and echo it.
Thank you to all.
Last edited by blocker; Mar 23rd, 2009 at 2:05 am.
![]() |
Similar Threads
- PLS I NEED YOUR HELP! Help on Reading and Editing of already Written CODE on php! (PHP)
- Please check my code below (Java)
- Return values from Perl to asterisk (Perl)
- C# calling parameterized Oracle storage procedure ? (C#)
Other Threads in the PHP Forum
- Previous Thread: SQL Statement in PHP
- Next Thread: All my buttons with javascript dont work.
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access action ajax apache api array auto beginner binary broken cakephp checkbox class cms code cron curl database date directory display domain download dynamic echo email error errorlog fatalerror file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link load login loop mail masterthesis menu mlm mod_rewrite multiple mysql oop parse paypal pdf php popup problem query radio random record recursion regex remote script search security server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube





