I have a basic skeleton php script. I want it to include a class and some methods.
<?php
class cName{
public static function funcName(){
echo 'this is a test';
}
}
cName::funcName();
?>
If I call the file from the command line like this
php fileName.php
I get the correct output.
this is a test
My question is, with best practice in mind, should I structure the file like this, just calling the file and letting the file call the method. Would it be better to call this method using a command line argument? If so could you explain a little how I might need to change the structure of the file and the format you would suggest for calling file from the command line.
there is simple ,
php /var/www/fileName.php
// output
> this is a test
or you can directly goto to directory of file run
www> php fileName.pgp