Text file(text.txt):
#Minecraft server properties
#Tue Sep 23 18:07:26 CEST 2014
generator-settings=
op-permission-level=4
allow-nether=true
level-name=world
enable-query=true
allow-flight=false
announce-player-achievements=true
server-port=25565
query.port=25565
level-type=DEFAULT
enable-rcon=false
force-gamemode=false
level-seed=
server-ip=
max-build-height=256
How to replace the value of some line, such as these:
server-port=25565
Replace with:
server-port=25585
But no to find 'server-port=25565' and replace with 'server-port=25585' It is found that the lines in which the server port and to allocate a value that needs to be replaced.
Example:
<?php
$myfile = fopen("text.txt", "r") or die("Unable to open file!");
...
fclose($myfile);
?>
EDIT: And when finded this and saved replace the text file.