Program: <?php function add($a,$b) { return $a+$b; } $c = add(10,20); echo "A+B: $c"; ...
Read More
Showing posts with label BasicofPHP. Show all posts
Showing posts with label BasicofPHP. Show all posts
14 Static variable in PHP
Program: <?php function display() { static $a = 10; $b = 20; echo "Static A= $a<br/>"; echo ...
Read More
13 Local and Global variables in PHP
Program: <?php $a = 10; function display() { global $a; echo "Global A= $a <br>"; $a = 20; $b = 30; ...
Read More
9 Execution and Conditional Operator in PHP
Program: <?php #Exceution Operator $output = `ls -l`; echo $output; #Displays long list of files from present direc...
Read More
8 Foreach loop in PHP
Program: <?php $arr = array(1,2,3,4,5); foreach ($arr as $value) { echo $value." "; } ?> Output:
Read More
6 PHP inside HTML
Program: <html> <body> <select> <?php for($i=0;$i<50;$i++) { ...
Read More
5 For Loop in PHP
Program: <?php for($i=5;$i<=10;$i++) { echo "$i "; } ?> Output:
Read More
4 Do While Loop in PHP
Program: <?php $i = 0; do{ echo "$i "; $i++; }while($i<5) ?> Output:
Read More
Subscribe to:
Posts (Atom)