Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Name:
- // Aim:
- // Date:
- // En.No:
- // PC No:
- $globalVariable = 10;
- function AirthOperation($localVariable) {
- global $globalVariable;
- $sum = $localVariable + $globalVariable;
- $subtraction = $localVariable - $globalVariable;
- $division = $localVariable / $globalVariable;
- $modulus = $localVariable % $globalVariable;
- $multiplication = $localVariable * $globalVariable;
- echo "Sum: $sum<br>";
- echo "Subtraction: $subtraction<br>";
- echo "Division: $division<br>";
- echo "Modulus: $modulus<br>";
- echo "Multiplication: $multiplication<br>";
- $GLOBALS['sumValue'] = $sum;
- }
- function IncDecOperation() {
- global $globalVariable;
- $preIncrement = ++$globalVariable;
- $preDecrement = --$globalVariable;
- $postIncrement = $globalVariable++;
- $postDecrement = $globalVariable--;
- echo "Pre-Increment: $preIncrement<br>";
- echo "Pre-Decrement: $preDecrement<br>";
- echo "Post-Increment: $postIncrement<br>";
- echo "Post-Decrement: $postDecrement<br>";
- }
- function stringconcat($string1, $string2) {
- $output = $string1 . ' ' . $string2;
- echo "Concatenated String: $output<br>";
- }
- AirthOperation(5);
- IncDecOperation();
- stringconcat("php", "with mysql");
- echo "Sum Value using reference variable: {$GLOBALS['sumValue']}<br>";
- $variable = "PHP";
- echo 'Single Quotes: $variable<br>';
- echo "Double Quotes: $variable<br>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement