JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform working. added some encodings and formatters.
[wfpl.git] / basics.php
1 <?php
2
3 function read_whole_file($name) {
4         $fd = fopen($name, 'r');
5         if($fd === false) {
6                 die("Failed to read file: '$name'");
7         }
8         $temp = fread($fd, filesize($name));
9         fclose($fd);
10         return $temp;
11 }
12
13 function unix_newlines($str) {
14         $str = str_replace("\r\n", "\n", $str);
15         return str_replace("\r", "\n", $str);
16 }
17
18
19 ?>