I think you can set up environment variables to do that, for example, if you are using Microsoft Windows, tryc:\>set a=100
c:\>php test.phpor you can add this line to your code:
$a=$argv[1];then do
c:\>php test.php 100

解决方案 »

  1.   

    PHP预定义的变量:
    'argv'
    Array of arguments passed to the script. When the script is run on the command line, this gives C-style access to the command line parameters. When called via the GET method, this will contain the query string. 
    'argc'
    Contains the number of command line parameters passed to the script (if run on the command line). 
    命令:
    x:\phpPath\php test.php arg1 arg2 arg3test.php是第0个参数
    test.php:
    <?
    echo $argc."个参数\n";
    print_r($argv);
    ?>
      

  2.   

    试了一下,使用set a=100的方法没有用呀,
    我做了一个简单的WEB服务器,想做成能支持PHP脚本的,接口是自怎样的呀,
      

  3.   

    IIS只要指定一下php.exe在哪就行了,那参数是怎么进去的呢?
      

  4.   

    "我做了一个简单的WEB服务器,想做成能支持PHP脚本的,接口是自怎样的呀,"
    另发一帖啦??
      

  5.   

    php a.php?act=val
    这样好像不对呀
      

  6.   

    accorind to this:
    http://php.libero.it/manual/en/features.commandline.phpyou should do php a.php "&a=100"anyone confirm? (I don't have PHP)