system("php ./somescript.php $something >/dev/null &");
can be split up as:
system(
This is the php function to execute a command in shell
system("php
We are asking the php
command line interpreter to be run
system("php ./
we are asking the interpreter to look in current directory using ./
system("php ./somescript.php
we are saying that the php file to be executed in somescript.php
system("php ./somescript.php $something
we are passing $something
which is a variable in the script running system()
as an argument into the script somescript.php
system("php ./somescript.php $something >/dev/null
we are saying that the output should be sent to /dev/null
..which basically means do not print any output on the screen. >
is the redirection command. So > /dev/null
means redirect output to /dev/null which is like an alias for a "null device" or simply..nothing.
system("php ./somescript.php $something >/dev/null &");
Lastly we are asking the script to be run in the background using &
which means as soon as the script starts, control is returned back to the shell