PHP excels at manipulating text files; however, if you want to write to a Squid proxy log you may have issues since PHP runs generally as the 'web-user' (nobody, daemon, httpd, www, etc.)
Look at the following functions in the manual at [url]www.php.net:[/url]
fopen(), fread(), fclose();
file_get_contents();
file();
Look also at all the commands dealing with strings and arrays.
HTH,