[PHP] Re: exploding

2004-08-26 Thread Daniel Schierbeck
M. Sokolewicz wrote: Jake McHenry wrote: Hi everyone. Is there a way to explode by every character in the variable? Example: $var = "8"; $test = explode("", $var); output would be $test[0] = 0; $test[1] = 0; $test[2] = 0; $test[3] = 0; $test[4] = 8; Can I get an array like that? Thanks, Jake M

Re: [PHP] Re: exploding

2004-08-25 Thread Peter Brodersen
On Thu, 26 Aug 2004 00:57:43 +0200, in php.general [EMAIL PROTECTED] (Felix) wrote: >$array = explode( ' ', chunk_split( $sting, 1, ' ' ) ); > >http://www.php.net/manual/de/function.explode.php >http://www.php.net/manual/de/function.chunk-split.php Well, that would leave a blank entry end of the

Re: [PHP] Re: exploding

2004-08-25 Thread Felix
Try this: $array = explode( ' ', chunk_split( $sting, 1, ' ' ) ); http://www.php.net/manual/de/function.explode.php http://www.php.net/manual/de/function.chunk-split.php On Thu, 26 Aug 2004 00:50:09 +0200, Peter Brodersen <[EMAIL PROTECTED]> wrote: > Hi, > > On Wed, 25 Aug 2004 18:00:49 -0400

[PHP] Re: exploding

2004-08-25 Thread Peter Brodersen
Hi, On Wed, 25 Aug 2004 18:00:49 -0400, in php.general [EMAIL PROTECTED] (Jake McHenry) wrote: >Hi everyone. > >Is there a way to explode by every character in the variable? > >Example: > >$var = "8"; >$test = explode("", $var); Use preg_split(): http://php.net/preg_split - example 2. Or,

[PHP] Re: exploding

2004-08-25 Thread M. Sokolewicz
Jake McHenry wrote: Hi everyone. Is there a way to explode by every character in the variable? Example: $var = "8"; $test = explode("", $var); output would be $test[0] = 0; $test[1] = 0; $test[2] = 0; $test[3] = 0; $test[4] = 8; Can I get an array like that? Thanks, Jake McHenry MIS Coordinato

[PHP] RE: exploding strings

2002-11-20 Thread COQUET,JULIEN (HP-France,ex1)
heh does the job :) $value){ if ($value==1) { print ''.$value.''; } } ?> -Original Message- From: Michael P. Carel [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 5:54 AM To: Subject:

[PHP] Re: exploding values into new variables

2002-10-28 Thread Erwin
Petre Agenbag wrote: > Hi > The manual states: > > $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; > $pieces = explode(" ", $pizza); > > So, if I want to be able to echo piece1 to the screen at a later > stage, I would go: > > echo $pieces[0]; > > or > $first_piece = $pieces[0]; > echo $f

[PHP] Re: Exploding Zip Codes! (Using PHP's explode function)

2002-08-12 Thread Bogdan Stancescu
If that's the exact string you have (which I doubt) then your code should look something like Notes on the code above: 1. Your string most probably doesn't look like that, in which case you'll have to adapt the code to it; 2. You'll have to do some custom changes to the first and last entry