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
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
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 =
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
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
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';
}
}
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;
7 matches
Mail list logo