Hi, On 5/13/05, SG Edwards <s0460205@xxxxxxxxxxxx> wrote: > I have a postgres database connected to a website using PHP. > I have a table that stores gene sequences which are very long (approx. 800 > characters). > > If I try and print this, it prints as a single line which runs off the page. Is > there a way to print the sequence with a line break every 50 characters? > > for example, > > AAAAAAAAAAAACCCCCCCCCCC > TTTTTTTTTTTTTTTTGGGGGGG > AAAAAAAAATTT > > Rather than: > AAAAAAAAAAACCCCCCCCCCCCTTTTTTTTTTTTTGGGGGGGGGGGAAAAAAAAAATTT You can write a simple wrap function for it. For example: function wrapAndPrint($text, $maxLineLen = 50) { // We don't need to make a strlen() call everytime. $lineLen = strlen($text); for ( $i = 0; $i < $lineLen; $i++ ) print $text[$i].(( $i % $maxLineLen == 0 ) ? '\n' : ''); } And then you can call wrapAndPrint() function everytime, when you need to print fetched rows from the query result. (Also it's possible to write a PL/WHATEVER function for it too.) Regards.