[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

[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 Coordinator

[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. ?php $var =

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, in

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

[PHP] RE: exploding strings

2002-11-20 Thread COQUET,JULIEN (HP-France,ex1)
heh does the job :) ?php $no=(1+2+3); $number=explode(+, $no); foreach ($number as $key=$value){ if ($value==1) { print 'span style=color:red;'.$value.'/span'; } }

[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 $first_piece;