php - How to set exec result to an array? -


how can save exec result array or list, , show result php?

exec('./script.sh'); 

this script contains list of ips.

the content of script following:

echo nmap -sp 192.168.2.0/24 | cut -d "i" -f1 | cut -d " " -f2 | grep 192.168.2.*

thanks!

$result = []; exec('./script.sh', $result); var_dump($result); 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -