note 36999 added to function.str-replace
| From: | atr at mrcoffee dot org | Date: | Thu, 30 Oct 2003 06:14:12 +0000 |
| Subject: | note 36999 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59511@lists.php.net to get a copy of this message | ||
Simple and quick dirty way to get a MOTD (on a UNIX system) displayed properly on the web. Or, any
file with the UNIX newline char "\n".
$motd = "/etc/motd";
$file = fopen("$motd", "r");
$content = fread($file, filesize($motd));
$content2 = str_replace("\n", "<br>", $content);
fclose($file);
print $content2;
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36999
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36999&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36999&report=yes
Search -- http://master.php.net/manage/user-notes.php