php shell_exec output as string code example
Example 1: exec output php
$output = exec('ls');
Example 2: shell use command output as string
# you can use "$(command)" to use the output of the evaluation of command as string :
echo "Lorem $(date +"%d.%m.%y") Ipsum"
#>Lorem 17.02.21 Ipsum