Re: [PHPLIB] The Most-Frequently-Asked Question From: Alexander Aulbach (ssilk <email protected>)
Date: 02/24/00

On Thu, 24 Feb 2000, Holger Blasum wrote:

}Hi Marc,
}
}Detlev Wagner wrote:
}>
}> set the variable require-final-newline to 'nil' in your .emacs file. So
}> Emacs will not automattically add a newline at the end of each file.
}> There should be similar configuration options for the other editors...
}>
}> Detlev
}>
}
}To achieve the same effect in vim (on many systems vi is aliased to
}vim), you can use "set binary". On true vi AFAIK it should not be a
}problem anyway.
}
}The following (unelegant performance killer!) might help you debugging
}...
}
}function my_inc ($filename) {
}
} $string = fread ($fp, 100000);
}
} if ($white = ereg("^[^<]+",$string))
} {
} echo "\n<BR>Leading junk ($white) in $filename";
} }
}
} if ($white = ereg("[^>]+$",$string))
} {
} echo "\n<BR>Trailing junk ($white) in $filename";
} }
}
} include ($filename);
}}

Dosn't work in all cases, cause this include is in the scope of a
function. More correct would be:

function my_inc ($filename) {
        $string = fread ($fp, 100000);
        if ($white = ereg("^[^<]+",$string)) {
            echo "\n<BR>Leading junk ($white) in $filename";
        }
        if ($white = ereg("[^>]+$",$string)) {
            echo "\n<BR>Trailing junk ($white) in $filename";
        }
        return ($filename);
}

include (my_inc($filename));

In this case I would rename the function to "check_include()" or somthing
similar.

-- 

SSilk - Alexander Aulbach - Herbipolis/Frankonia Minoris - (0931)22032

- PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>. To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in the body, not the subject, of your message.