answersLogoWhite

0


Best Answer

// a very simple calculator


if(isset($_GET['value1']))
{
$val1 = $_GET['value1'];
$val2 = $_GET['value2'];
$operand = $_GET['operand'];
eval('$result=' . $val1 . $operand . $val2);
?>Result: }


?>




User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you create a calculator using PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why do we use Php?

PHP is an Open Source Scripting Language. We can create Web Pages and Web Applications using PHP.


How do you create a web mail script using PHP?

You can use phpMailer() Or, you can use mail() PHP function to send emails via PHP script.


How do you make a blog using PHP and MySQL?

You can create blog in php. In fact, many blogs on the internet created using php. There are many readymade blogs which you can install on your own server. Or, if you wish, you can create your own blog application. Simply, blog is a dynamic website (users can add, delete, update content) and PHP was designed for creation of dynamic websites.


Why is PHP used?

PHP is used to create dynamic websites, this is a step up from HTML as it allows you to do much more than creating static websites. Using a language such as PHP also gives you access to using databases with your website such as MySQL.


How can you create a website without using a host like Shutterfly?

Maybe try mySQL or PHP?


How do you create a redirect webpage?

If you are using PHP you could use this code: (In the <head>) <?php HEADER("Location: http://www.rasclerhys.com"); ?> That should automatically take you to "www.rasclerhys.com"


How do you create a DIV type file using PHP?

A file with the DIV file extension is a DivX Movie file, it cannot be created with PHP. PHP is a web programming language for web site building.


How do you install crystal reports for php?

how to create report in php


How does you create a delete button in PHP using Dreamweaver?

That question doesn't make much sense...delete for what?


How do you make a login using PHP?

Create an HTML form with METHOD="post" and ACTION="login2.php". In login2.php check if the entered username and password are correct. You can get the username with $_POST['name_of_username_input']. The same goes for the password.


How do you create an area of a webpage to display PHP results?

PHP code blocks start with <?php and end with ?>.


How do you create a PHP script?

To create a PHP script all you have to do is create a new file, then save the file as "filename.php". It must have a .php file extension.After that open the file and put in the PHP tags like shown.Then you write your PHP script within those tags and upload to your web space and check it out.