Page 1 of 1

possible to split array element?

Posted: Sun Jan 15, 2006 8:55 pm
by joecrack
i have an array element that looks like this:

$data['0']=12.34.8888

Now i would like to splitt this element into:

$newdata1['0']=12.34.
$newdata2['0']=8888


Is that possible?

Posted: Sun Jan 15, 2006 9:05 pm
by John Cartwright
Yes it is possible using explode(), but can you expect the data to be in a certain format?

In your example you have x.x.x, and you want to split the first two from the third, so is there always going to be 2 decimals?

Posted: Sun Jan 15, 2006 9:33 pm
by joecrack
i will ALWAYS be the same format ...
thanks .. i solved it =)