Is it possible to rewrite a string in PHP. let me be more clear using examples.
My array
array{
[DEVICE] => eth0,
[IPADDR] => 192.168.0.2,
[NETMASK] => 255.255.255.0,
[NETWORK] => 192.168.0.0,
[BROADCAST] => 255.255.255.255,
[GATEWAY] => 192.168.0.1,
[ONBOOT] => no
}
Transfer files to file
DEVICE=eth0
IPADDR=192.168.200.2
NETMASK=255.255.255.0
NETWORK=192.168.200.0
BROADCAST=255.255.255.255
GATEWAY=192.168.200.1
ONBOOT=no
DNS1=195.100.10.1
The result of the file that is overwritten
DEVICE=eth0
IPADDR=192.168.0.2
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=255.255.255.255
GATEWAY=192.168.0.1
ONBOOT=no
DNS1=195.100.10.1
Note that DNS1=195.100.10.1Stays in the file, because the associate professor has a key with a value DNSin our array.
thank
source
share