Example
<?php
echo php_uname();
?>
Ouput
Linux phpcodez-System-Product-Name 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686
Example
<?php
echo php_uname();
?>
Ouput
Linux phpcodez-System-Product-Name 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686
Example
<?php
chdir(‘/usr/local/’);
echo realpath(‘./../../var/www/’);
?>
Ouput
/var/www
Example
<?php
$date = new DateTime(‘2006-05-17’);
$date->modify(‘+2 day’);
echo $date->format(‘Y-m-d’);
?>
Output
2006-05-19
<?php
$date = date_create(‘2007-05-17’);
date_modify($date, ‘+2 day’);
echo date_format($date, ‘Y-m-d’);
?>
Output
2007-05-19
<?php
$date = new DateTime();
$date->setISODate(2007, 7);
echo $date->format(‘Y-m-d’) ;
?>
Output
2007-02-12
Example
<?php
$date1 = date_create();
date_isodate_set($date1, 2007, 2);
echo date_format($date1, ‘Y-m-d’);
?>
Output
2007-01-08
<?php
$interval = new DateInterval(‘P12Y14DT16H18M’);
echo $interval->format(‘%d days’);
?>
Output
14 days
<?php
$interval = new DateInterval(‘P12D’);
echo $interval->format(‘%d days’);
?>
Output
12 days
<?php
echo “<pre>”;
$interval = DateInterval::createFromDateString(‘1 month’);
print_r($interval);
?>
Output
DateInterval Object
(
[y] => 0
[m] => 1
[d] => 0
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
<?php
echo “<pre>”;
$interval = DateInterval::createFromDateString(‘1 month’);
print_r($interval);
?>
Output
DateInterval Object
(
[y] => 0
[m] => 1
[d] => 0
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)