-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask2.php
More file actions
25 lines (24 loc) · 810 Bytes
/
task2.php
File metadata and controls
25 lines (24 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<head>
<title>PHP task2</title>
</head>
<body>
<?php
// function give the next char. of given char.
function nextLitter($litter){
$asc = ord($litter); //convert char to ASC
if ($asc == 90){ // if Z is given will return A
$result = 65;
}elseif ($asc == 122){ // if z is given will return a
$result = 97;
}else{ //give the next char by adding one to the original char (in ASC form)
$result = $asc+1;
}
return(chr($result)); //re-convert the result ASC to char
}
echo nextLitter("G")
/// ========= Arafa Khalaf Khalaf ===================
?>
</body>
</html>