pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[Fwd: Re: Help...]
1+ messages / 1 participants
[nested] [flat]

* [Fwd: Re: Help...]
@ 2002-12-16 22:57  Bret Hughes <bhughes@elevating.com>
  0 siblings, 0 replies; 1+ messages in thread

From: Bret Hughes @ 2002-12-16 22:57 UTC (permalink / raw)
  To: pgsql-php

I meant to reply all with this

On Mon, 2002-12-16 at 16:26, Francisco Mosse - (Zivals) wrote:
> Hi!
> 
> What is wrong? My server has PHP and Postgre
> I can“t understand hoy do I get this error... look
> I start with a value ($quebuscototal) and I should get an array like this ("'abc', 'def', 'ghi', 'jkl') ?
> but with this code, what I receive is an array where the first element is 'abc', 'def', 'ghi', 'jkl'
> instead of being 'abc' (and the second one, 'def', the third one 'ghi', etc.)
> 
> $quebuscototal = "abc def ghi jkl";
> $quebuscototal = str_replace(' ',' \', \'',$quebuscototal);
> $quebuscototal = "'$quebuscototal'";
> $quebuscofinal = array($quebuscototal);
> $quees = "$quebuscofinal[1] ";
> 
> What is wrong with my code? Thanks!!

I see what you are trying to do but I think that the internal
representation of the variable that contians the string :

'abc ', 'def ', 'ghi ', 'jkl'
is not the same as four seperate strings of abc def ghi jkl

Use the split function

$quebuscototal = "abc def ghi jkl";
$quebuscofinal = split(' ', $quebuscototal);
$quees = "$quebuscofinal[1] "

HTH

Bret




^ permalink  raw  reply  [nested|flat] 1+ messages in thread


only message in thread

Thread overview: 1+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-16 22:57 [Fwd: Re: Help...] Bret Hughes <bhughes@elevating.com>

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