...

View Full Version : Split value?



Kirl
08-20-2006, 02:58 PM
Wrong forum again... :rolleyes:

I seem to remember a delete function, but I can't find it. Sorry

BonRouge
08-20-2006, 03:05 PM
php


<?php
$number = 22.5456;
$numbers = explode(".", $number);
echo "<p>$numbers[0]</p>"; // number 1
echo "<p>$numbers[1]</p>"; // number 2
?>

Kirl
08-20-2006, 03:08 PM
Thanks, but I inteded to post this in the Javascript forum. If you know how to do this with javascript, that would be great. :)

BonRouge
08-20-2006, 03:31 PM
javascript
function splitm() {
var ournumber="123.456789";
var numbers=ournumber.split('.');
alert("number 1 :"+numbers[0]+" | number 2 :"+numbers[1]);
}
window.onload=splitm;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum