Dealing with argc and argv
<p>I wrote the code as follows:</p>

<pre><code>&lt;?php
array_shift($argv);
$taskid=$argv[0];
$file1=file_get_contents($argv[1]);
$file2=fopen($argv[2],"w");
echo $taskid."\n".$file1."\n".$file2."\n";
?&gt;
</code></pre>

<p>I execute this program as <code>php myfile.php 1 1.txt 2.txt</code>
Where 1 is the taskid, 1.txt is the input file and 2.txt is the output file.
I want to modify this program in such a way that it runs even though I don't pass any arguments that is like <code>php myfile.php</code> should run. I want to place an if condition for that. I worked with the conditions like <code>if(*argv&lt;=1)</code> and if(argc==NULL) etc., but none of them are working.</p>

<p>I need a perfect condition that checks if no arguments are passed then my program should show a user friendly message. </p>

<p>Can someone help me??</p>
