Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Split value?

  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Wrong forum again...

    I seem to remember a delete function, but I can't find it. Sorry
    Last edited by Kirl; 08-20-2006 at 03:02 PM.

  • #2
    Regular Coder BonRouge's Avatar
    Join Date
    Mar 2006
    Location
    Sendai, Japan
    Posts
    328
    Thanks
    0
    Thanked 0 Times in 0 Posts
    php

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

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    Thanks, but I inteded to post this in the Javascript forum. If you know how to do this with javascript, that would be great.

  • #4
    Regular Coder BonRouge's Avatar
    Join Date
    Mar 2006
    Location
    Sendai, Japan
    Posts
    328
    Thanks
    0
    Thanked 0 Times in 0 Posts
    javascript
    Code:
    function splitm() {
    var ournumber="123.456789";
    var numbers=ournumber.split('.');
    alert("number 1 :"+numbers[0]+" | number 2 :"+numbers[1]);
    }
    window.onload=splitm;


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •