background image

10

}   

11

  

12

if (isset($_SERVER['argv'][2])) {   

13

$

month

 = $_SERVER['argv'][2];   

14

} else {   

15

$

month

 = 

'null'

;   

16

}   

17

  

18

if (isset($_SERVER['argv'][3])) {   

19

$

day

 = $_SERVER['argv'][3];   

20

} else {   

21

$

day

 = 

'null'

;   

22

}   

23

  

24

echo 'date is '.$year.'-'.$month.'-'.$$day;   

25

?>

  

26

  

在命令行中运行:

 

XML/HTML 代码

27

/opt/modules/php/bin/php -f /opt/data/www/yoururl/index.php 2008 10 16  

 

输出:

 

XML/HTML 代码

28

date is 2008-10-16