• Administration
  • Spanish Classes
  • Society.
  • Culture.
  • English
    • Arabic
    • Bulgarian
    • Croatian
    • Czech
    • Danish
    • Dutch
    • English
    • Estonian
    • Finnish
    • French
    • Georgian
    • German
    • Greek
    • Hebrew
    • Hindi
    • Hungarian
    • Indonesian
    • Italian
    • Japanese
    • Korean
    • Latvian
    • Lithuanian
    • Norwegian
    • Persian
    • Polish
    • Portuguese
    • Romanian
    • Russian
    • Serbian
    • Slovak
    • Slovenian
    • Swedish
    • Thai
    • Turkish
    • Ukrainian
  • Twitter
  • Facebook
  • Instagram
  • Example of Calculations in PHP
    • Science.
    • Get To Know Us
    • Psychology. Top Definitions
    • History. Top Definitions

    Example of Calculations in PHP

    Php   /   by admin   /   July 04, 2021

    I leave a programming example in PHP. It works too simple, you just have to configure the two variables, $ FirstValue and $ SecondValue, currently they are at 10 and 30.

    php
    # Comments.
    # Simple PHP programming example
    # Doing simple calculations between predefined variables
    # For ExampleDe. Com
    $ FirstValue = 10; // Comment: Edit the number to change the first value
    $ SecondValue = 30; // Comment: Edit the number to change the second value
    // Calculation section
    $ sum = $ FirstValue + $ SecondValue; // We add
    $ subtraction = $ FirstValue - $ SecondValue; // We subtract
    $ multiplication = $ FirstValue * $ SecondValue; // We multiply
    $ division = $ FirstValue / $ SecondValue; // We divide
    // Next we show the accounts in a textual format
    echo "

    Textual Format

    ";
    echo "The sum enter ". $ FirstValue." and
    ". $ SecondValue." is ". $ sum. "
    ";
    echo "The subtraction between ". $ FirstValue." and
    ". $ SecondValue. " is ". $ subtracts. "
    ";
    echo "The multiplication between ". $ FirstValue." and
    instagram story viewer
    ". $ SecondValue." is ". $ multiplication."
    ";
    echo" The division between ". $ FirstValue." and
    ". $ SecondValue." is ". $ division. "
    "; // Next we show the accounts in a mathematical format
    echo "

    Mathematical Format

    ";
    echo "". $ FirstValue. "+". $ SecondValue. " = ". $ sum."
    ";
    echo" ". $ FirstValue." - ". $ SecondValue." = ". $ subtract."
    ";
    echo" ". $ FirstValue." * ". $ SecondValue." = ". $ multiplication."
    ";
    echo" ". $ FirstValue." / ". $ SecondValue." = ". $ division."
    ";

    This example in PHP would show the following

    The sum Come in 10 Y 30 It is 40
    The subtraction Come in 10 Y 30 It is -20
    The multiplication Come in 10 Y 30 It is 300
    The division Come in 10 Y 30 It is 0.333333333333
    10 + 30 = 40
    10 - 30 = -20
    10 * 30 = 300
    10 / 30 =0.333333333333

    Tags cloud
    • Php
    Rating
    0
    Views
    0
    Comments
    Recommend to friends
    • Twitter
    • Facebook
    • Instagram
    SUBSCRIBE
    Subscribe to comments
    YOU MIGHT ALSO LIKE
    • Concept in Definition ABC
      Miscellanea
      04/07/2021
      Concept in Definition ABC
    • Concept in Definition ABC
      Miscellanea
      04/07/2021
      Concept in Definition ABC
    • Concept in Definition ABC
      Miscellanea
      04/07/2021
      Concept in Definition ABC
    Social
    9357 Fans
    Like
    6146 Followers
    Follow
    185 Subscribers
    Subscribers
    Categories
    Administration
    Spanish Classes
    Society.
    Culture.
    Science.
    Get To Know Us
    Psychology. Top Definitions
    History. Top Definitions
    Examples
    Kitchen
    Basic Knowledge
    Accounting
    Contracts
    Css
    Culture And Society
    Curriculum Vitae
    Right
    Design
    Art
    Job
    Polls
    Essays
    Writings
    Philosophy
    Finance
    Physics
    Geography
    Story
    Mexico History
    Asp
    Popular posts
    Concept in Definition ABC
    Concept in Definition ABC
    Miscellanea
    04/07/2021
    Concept in Definition ABC
    Concept in Definition ABC
    Miscellanea
    04/07/2021
    Concept in Definition ABC
    Concept in Definition ABC
    Miscellanea
    04/07/2021

    Tags

    • Basic Knowledge
    • Accounting
    • Contracts
    • Css
    • Culture And Society
    • Curriculum Vitae
    • Right
    • Design
    • Art
    • Job
    • Polls
    • Essays
    • Writings
    • Philosophy
    • Finance
    • Physics
    • Geography
    • Story
    • Mexico History
    • Asp
    • Administration
    • Spanish Classes
    • Society.
    • Culture.
    • Science.
    • Get To Know Us
    • Psychology. Top Definitions
    • History. Top Definitions
    • Examples
    • Kitchen
    Privacy

    © Copyright 2025 by Educational resource. All Rights Reserved.