pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Blanco <dablanco@gmail.com>
To: pgsql-php@postgresql.org
Subject: Re: Printing off the page....
Date: Fri, 13 May 2005 13:49:03 +0200
Message-ID: <ef2a8951050513044942a5251a@mail.gmail.com> (raw)
In-Reply-To: <1115978112.428479801cb7b@sms.ed.ac.uk>
References: <1115978112.428479801cb7b@sms.ed.ac.uk>

Hi!

2005/5/13, SG Edwards <s0460205@sms.ed.ac.uk>:
> 
> Hi guys,
> 
> 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?

This seems to be a PHP question, not about PHP-Posgresql :-)

If I understood you right, you can do it with the PHP function "substr"

http://php.net/substr

It's easy to iterate throug the string and to intercalate the line
breaks wherever you want

Bye



view thread (5+ messages)  latest in thread

Message-ID: <ef2a8951050513044942a5251a@mail.gmail.com>
Permalink:  ../ef2a8951050513044942a5251a@mail.gmail.com/
Also on:    postgresql.org/message-id/ef2a8951050513044942a5251a@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dablanco@gmail.com
  Subject: Re: Printing off the page....
  In-Reply-To: <ef2a8951050513044942a5251a@mail.gmail.com>
  References: <1115978112.428479801cb7b@sms.ed.ac.uk> <ef2a8951050513044942a5251a@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox