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

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -