$i = 0;
$line_len = strlen($words[$i])+1;
$line = "";
- while ($i < count($words)) {
- while ($line_len < $wrap) {
- $line = "$line$words[$i] ";
- $i++;
- $line_len = $line_len + strlen($words[$i])+1;
- }
- $line_len = strlen($words[$i])+1;
- if ($line_len < $wrap) {
- if ($i < count($words)) // don't <BR> the last line
- $line = "$line\n";
- } else {
- $endline = $words[$i];
- while ($line_len >= $wrap) {
- $bigline = substr($endline, 0, $wrap);
- $endline = substr($endline, $wrap, strlen($endline));
- $line_len = strlen($endline);
- $line = "$line$bigline<BR>";
+ if (count($words) > 1) {
+ while ($i < count($words)-1) {
+ while ($line_len < $wrap) {
+ $line = "$line$words[$i] ";
+ $i++;
+ $line_len = $line_len + strlen($words[$i])+1;
+ }
+ $line_len = strlen($words[$i])+1;
+ if ($line_len < $wrap) {
+ if ($i < count($words)) // don't <BR> the last line
+ $line = "$line\n";
+ } else {
+ $endline = $words[$i];
+ while ($line_len >= $wrap) {
+ $bigline = substr($endline, 0, $wrap);
+ $endline = substr($endline, $wrap, strlen($endline));
+ $line_len = strlen($endline);
+ $line = "$line$bigline<BR>";
+ }
+ $line = "$line$endline<BR>";
+ $i++;
}
- $line = "$line$endline<BR>";
- $i++;
}
+ } else {
+ $line = $words[0];
}
$line = str_replace(">", ">", $line);
function get_location () {
# This determines the location to forward to relative
- # to your server. If this doesn't work correctly for
+ # to your server. If this doesnt work correctly for
# you (although it should), you can remove all this
# code except the last two lines, and change the header()
# function to look something like this, customized to