
Well,... not really. That function doesn't really do what i need it to do :( I'm working on it though. substituting \s with works a bit, but still breaks the layout a bit. I might try ward his second suggestion (although it doesn't really seem fast). Michiel Thomas Abeel wrote:
Solved more than an hour ago:
http://www.w3schools.com/PHP/func_string_htmlentities.asp
No messing around with regex
Ward Blondé wrote:
Do you already have a solution for this? I am trying to improve my regex-skills. My solution would be: replace every \s by a  . Maybe not good enough... Or replace every \s\s by \s , loop over it until there are no more \s\s, and then replace every \s  by   .
Ward
Michiel Van Bel wrote:
K, my brain hurts a bit... I have a plain-file(blast-output) that's already been formatted.
Of course, when I just read it in php and send it to html, the layout is totally gone (newlines, spaces, tabs, ...). Anyone has an idea how to easily fix it?
$data = str_replace("\n","<br/>",$data); //fixes newlines
I'd say that replacing every multiple (2+) occurrence of a space should be replaced by the same multiple of (   ), but I can't figure it out exactly (brain is still hurting):
$data = preg_replace("/(\s)(\s+)", ... ,$data); // -->how do you get the count of \s+ ???, so i can replace it by the same count of  's ?
anyone?
_______________________________________________ Binari Intellectuals Need And Require Insanity https://maillist.psb.ugent.be/mailman/listinfo/binari
-- ================================================================== Michiel Van Bel PhD student Tel:+32 (0)9 331 36 95 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM mibel@psb.ugent.be http://www.psb.ugent.be ==================================================================