This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function Division($a , $b , $c){ | |
| return $a / $b / $c; | |
| } | |
| $a = 15; | |
| $b = 6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $a = array(4 , 4 , 5 , 6 , 7); | |
| if($a[0] = 4 && $a[3] = 6){ | |
| echo "yes, it is"; | |
| } | |
| else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $a = 100; | |
| $b = 300; | |
| $c = 700; | |
| $d = 900; | |
| function Plus($a , $b , $c , $d){ | |
| return $a + $b + $c + $d; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $a = 100; | |
| $b = 40; | |
| function Minus($a , $b){ | |
| return $a - $b; | |
| } | |
| $r = Minus($a , $b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* a few functions for debugging in php */ | |
| $a = 100; | |
| $b = 500; | |
| $c = 3.333; | |
| $r = var_dump($c); | |
| $e = print_r($b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| try{ | |
| $x = 0; | |
| $y = Inverse($x); | |
| echo "The Inverse Of $x is $y"; | |
| }catch (Exception $e){ | |
| $y = "Undefined"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| print_r($_SERVER); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function get_value($param, $default = null) { | |
| if(isset($_GET[$param])) { | |
| $value = $_GET[$param]; | |
| } else { | |
| $value = $default; | |
| } | |
| return $value; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $text = "Welcome to PHP !"; | |
| $a = urlencode($text); | |
| $b = urldecode($a); | |
| echo '<p>Original text: '.$text."</p>"; | |
| echo '<p>After urlencode: '.$a."</p>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function My_func($a , $b , $c , $d , $e){ | |
| if($a > 20 && $b < 10){ | |
| $a = $a / 2; | |
| $b = $b * 2; | |
| } | |
| else{ | |
| $a = $a; |