Hello
due to shell_exec disabled in my host, I need to replace following 3 commands with php (without using shell_exec)
shell_exec(“mkdir /home/ft/public_html/file”);
shell_exec(“chmod 755 /home/ft/public_html/file/data.txt”);
$vust=rtrim(shell_exec(“grep \“cus_name:=\” /home/ft/public_html/file/data.txt”));
is there a way to execute above commands without using
shell_exec ?
Thank you
mkdir()
chmod()
preg_grep()
Another alternative would be the system() functionality PHP has
thank you but how to use preg_grep() to receive only $vust ?
What exactly is the return value of $vust?
By the look of it your simply searching for cus_name:=, am i correct?
it should return a single value , like “minnie” . For this reason I do not need to use array .
Would be easier to answer if we can see an example of data.txt