Ok lets say that I have a file called File.txt and it contains
Hello World !!!!!
Ok, now I have this so that they can send something added to the string. But it should be right below the line "Hello." How should I do it?
$mystring="string to append"; $file="file"; $data = file($file); foreach ($data as $k=>$v){ if ( strpos($v,"Hello") !==FALSE){ $data[$k]=$data[$k] . "$mystring\n"; } } file_put_contents($file,$data);
Source: https://habr.com/ru/post/1733462/More articles:Transfer MachineKey from iis6 to the old server on iis7 on the new server - cookiesFinal recursive call question - .netHow to avoid downloading a schema file from the Internet during spring - spring initializationSearch for jQuery plugin that can blur / hide text - jqueryIs it possible to resolve the host name from an IP address without DNS? - windowsBasic data compared to SQLitePersistentObjects - iphoneGet the value of a resource * without * using GetGlobalResourceObject - asp.netA program that requires a boost in the startup registry section (windows 7) - windows-7Как вернуть несколько классов как IQueryable - linq-to-sqlHow to change html site when B does something - javascriptAll Articles