0% found this document useful (0 votes)
9 views

Lab Session 3

Uploaded by

Dawit Sebhat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lab Session 3

Uploaded by

Dawit Sebhat
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Global Keywords Concatenating Strings

<?php <?php

$x=5; $s1 = 'Hello, ';

function myTest() { $s2 = 'world!';

global $x,$y; $greeting = $s1 . $s2;


echo $greeting;
$y= 10;
?>
$y=$x+$y;
Adjusting String Case
}
<?php
myTest();
$str =”hello class this is lab session three!”
echo $y;
$a= $str.ucfirst();
?>
$b =$str.ucwords();
Static Keywords
$c= $str.strtoupper() ;
<?php
$d= $str.strtolower() ;
function myTest()
echo $a;
{
echo $b;
static $x=0;
echo $c;
echo $x;
echo $d;
$x++;
?>
}
Operators in PHP
myTest();
<?php
myTest();
$A = 10;
myTest();
$C= 5;
?>
$D= $A%$C;
Manipulating Strings
$C %= $A;
<?php
echo $C; ?>
$x = "Hello world!";

echo $x;

echo "<br>";

$x = 'Hello world!';

echo $x;

?>

You might also like