Jump to content

command line arguments


leela

Recommended Posts

 

hello,

 

my problem is :

 

i am able to set and get the properties using files , but i want to create from command line..

here is my code

 

switch($argv[1])

{

 

case 4:

while (list($key, $value) = each($php_arr))

{

if(array_key_exists($argv[2],$php_arr)!='')

{

echo $php_arr[$argv[2]];

 

$php_arr[$argv[2]]=ini_set($argv[2],$argv[3]);

 

}

else {echo "keyword not found";}

}

print_r($php_arr);

break;

default:

print_r($php_arr);

}

 

the above code works if i give values  root@ubuntu:/var/www/assign2/sel# php -q test.php 4 max_execution_time 30

 

BUt i want to ask for value to enter  , suppose it is case 1 , then after entering 1 ..then it shud again ask for values ...

 

can anyone give idea..

 

Thanks,

leela

 

 

Link to comment
https://forums.phpfreaks.com/topic/239514-command-line-arguments/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.