use expolde, here are two examples
$number = '358253.37845';
$pieces = explode('.', $number);
echo $pieces[0]; //358253
echo $pieces[1]; //37845
or
list($first, $second) = explode('.', $number);
echo $first; //358253
echo $second //37845
untested but should get you in the right direction se the manual for explode in case I have typo's
Main Topics
Browse All Topics





by: Raynard7Posted on 2006-12-20 at 16:28:21ID: 18177609
Hi,
Something like this should work
<?php
$mystring = '123.456';
$findme = '.';
$pos = strpos($mystring, $findme);
if ($pos === false) {
$newString = $mystring;
} else {
$newString = substr($mystring, $pos);
} // end if
echo $newString;
?>
this should find the first position of . and then return everything to the right of it - if there is no . it will return the original string into $newString. You could make this into a function if you are using it regularly.