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 5 of 5
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mathematics and PHP

    Any good tutorials on doing basic math in PHP?

    i.e. 9*7, 8/68, 2+2, 4-2, etc. etc.

    Thanks
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just put it in a expression and execute it:

    PHP Code:
    print 7
    Or did you have something different in mind?
    De gustibus non est disputandum.

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, sorry for posting, found it in the PHP Manual right after I posted.

    Thanks mordred
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #4
    New Coder
    Join Date
    Sep 2003
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <?php
    $something = (89234 * 2382378 + 24 / 10);
    echo $something;
    ?>

  • #5
    New Coder
    Join Date
    Jan 2003
    Location
    Tulsa, OK
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For continuity sake, try seperating your arguments for calculation.

    Good for debugging as well.

    PHP Code:
    <?php
    $something 
    = ((89234 2382378) + (24 10));
    echo 
    $something;
    ?>


  •  

    Posting Permissions

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