Как создать массив для скрипта: <?php $file = fopen('172.17.1.11.cfg', 'r'); $text = fread($file, filesize('172.17.1.11.cfg')); fclose($file); $file = fopen('172.17.1.11.cfg_', 'w'); $text = str_replace('blackhole', 'shutdown', $text); $text = str_replace('anti-arpscan recovery time 1800', 'anti-arpscan recovery time 3600', $text); $text = str_replace('loopback-detection control-recovery timeout 1800', 'loopback-detection control-recovery timeout 3600', $text); $text = str_replace('ip dhcp snooping action shutdown recovery 900', 'ip dhcp snooping action shutdown recovery 3600', $text); $text = str_replace('ip dhcp snooping action shutdown recovery 1800', 'ip dhcp snooping action shutdown recovery 3600', $text); fwrite($file, $text); fclose($file); ?> Вот сделал наброски но скрипт правильно не работает! <?php $mass_ip = array ('172.17.0.4.cfg', '172.17.0.5.cfg', '172.17.0.6.cfg'); foreach($mass_ip as $value) { $file = fopen('$value', 'r'); $text = fread($file, filesize('$value')); fclose($file); $file = fopen('$value_', 'w'); $text = str_replace('blackhole', 'shutdown', $text); $text = str_replace('anti-arpscan recovery time 1800', 'anti-arpscan recovery time 3600', $text); $text = str_replace('loopback-detection control-recovery timeout 1800', 'loopback-detection control-recovery timeout 3600', $text); $text = str_replace('ip dhcp snooping action shutdown recovery 900', 'ip dhcp snooping action shutdown recovery 3600', $text); $text = str_replace('ip dhcp snooping action shutdown recovery 1800', 'ip dhcp snooping action shutdown recovery 3600', $text); fwrite($file, $text); fclose($file); print_r ($mass_ip); } ?> Подскажите что не так!