mysqlfrk
Programmer
- Aug 3, 2011
- 12
I have this program-
<?php
$fname=$_SERVER['argv'][1];
$lname=$_SERVER['argv'][2];
echo "Hello!$fname \n";
echo "Hello!$lname \n";
print_r($_SERVER['argv']);
?>
Here I try to output these 2 names in 2 lines in DOS command prompt like this-
Samuel
Johnson
Unfortunately it is not showing the the 2nd output.I have saved the program as 1.php. I give this command in C prompt like these
C:\>php 1.php Samuel Johnson
Its just showing the first line
Hello! Samuel
Array
(
[0]=>1.php
[1]=>Samuel
[2]=>Johnson
)
Instead, what I want is this -
Hello!Samuel
Hello!Johnson
Array
(
[0]=>1.php
[1]=>Samuel
[2]=>Johnson
)
What can be the problem & how to rectify this?
<?php
$fname=$_SERVER['argv'][1];
$lname=$_SERVER['argv'][2];
echo "Hello!$fname \n";
echo "Hello!$lname \n";
print_r($_SERVER['argv']);
?>
Here I try to output these 2 names in 2 lines in DOS command prompt like this-
Samuel
Johnson
Unfortunately it is not showing the the 2nd output.I have saved the program as 1.php. I give this command in C prompt like these
C:\>php 1.php Samuel Johnson
Its just showing the first line
Hello! Samuel
Array
(
[0]=>1.php
[1]=>Samuel
[2]=>Johnson
)
Instead, what I want is this -
Hello!Samuel
Hello!Johnson
Array
(
[0]=>1.php
[1]=>Samuel
[2]=>Johnson
)
What can be the problem & how to rectify this?