Site icon NgDeveloper

Argv in php example

Argv is used to get the console array input. But array(0) always contains the name of the script we are running.

Syntax:

$arrayget = array($argv);         

//arrayget is the name of the array and argv via we are getting and storing the values in arrayget from console.

Program:

<?php

$arrayget = $argv;

print_r($arrayget);

?>

 

Output:

 

 

 

Thanks for reading this post………….!!!

Exit mobile version