Jump to content

$temp=explode('/',$value['fieldname']) only giving one value


kellan4459

Recommended Posts

I am trying to split a simple string from my db

it is in the format #/#

1/5

2/5

3/3

4/2

etc...

 

I have the following:

 


echo $value.'<BR>';
        	
$temp=explode('/',$value['field']);
     
print_r($temp);

echo '<br>';

when I execute the above (it's in a for loop) I get the following output

 

1/5

Array ( [0] => 1 )

2/5

Array ( [0] => 2 )

3/3

Array ( [0] => 3 )

4/2

Array ( [0] => 4 )

 

 

I am expecting

1/5

Array ( [0] => 1 [1] => 5)

for the first entry and so on down the line showing both values after the explode. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.