Web Systems and Technologies 2 Notes
Web Systems and Technologies 2 Notes
5. Deployment
Includes everything required to get the application live online
Version Control
Learn Git to manage code versions and contributions
across branches
Containerization
Docker to package the application with all its
dependencies
Orchestration Tools
Kubernetes for managing containerized applications
CI/CD
Jenkins, GitLab CI, Travis CI for automating the build, test,
and deploy process
Cloud Providers
AWS, Azure, and Google Cloud to host the application
Monitoring and Analytics
Tools like Prometheus and Google Analytics for tracking
performance and user engagement
strtolower(), strtoupper()
Convert a string to lowercase and uppercase respectively date()
and return the new string. Accepts an optional timestamp and formats the
The original string is not changed. timestamp into a more readable string.
If timestamp is not provided, it formats the current
$greeting = “Hello World!”; Hello World! timestamp.
$str1 = strtolower($greeting); hello world!
$str2 = strtoupper($greeting); Suppose we want to format a timestamp that is 10 hours
HELLO WORLD! from the current time, we can use the statement below:
echo “<BR>”.$greeting;
echo “<BR>”.$str1; echo date(“d-M-Y”, strtotime(“+10 hours”));
echo “<BR>”.$str2;
The first argument specifies how we want the timestamp
to be formatted. To do that, we use a string consisting of
punctuation marks and predefined characters
trim()
Removes whitespaces from the front and end of a string
by default and returns the new string. “d-M-Y”
You can specify other characters for it to remove by “d” indicates that we want the day to be represented as a
passing a second optional argument to the function. two-digit number, using a leading zero if necessary (e.g., 3 is
output as 03).
$stmt = “ is ”; “M” and “Y” indicate that we want the month and year to be
echo “PHP”.$stmt.“Fun<BR>”; PHP is Fun represented as a three-letter text (e.g., Jan) and a four-digit
echo “PHP”.trim($stmt).“Fun<BR>”; PHPisFun number respectively.
$stmt2 = “**Hello**World**”; Hello**World punctuation mark “-” indicates that we want the day,
echo trim($stmt2,“*”); month and year to be separated by hyphens.
Setting The Timezone
substr() The results returned by the date() function are affected by the
Returns a substring. time zone set in the PHP server.
To use this function, we need to pass two arguments to it - For instance, while echo date('d-M-Y', strtotime("+ 10 hours"));
the string to extract the substring from and the position to gives us 03-Apr-2020 in one time zone, it may give us 04-Apr-
start extracting it. 2020 in another.
We can also pass a third argument to specify the length To avoid any discrepancy in results, it’s strongly recommended
of the substring to extract. that you manually set the timezone in your PHP server if you want
to use any date/time function in PHP.
If we do not provide this argument, the function extracts
the substring starting from the specified starting position
to the end of the string.
Positions in strings start from 0, not 1. For instance, if we
have a string 'ABCDEF', 'A' is at position 0, 'B' is at position 1
and so on.
Positions can also be negative. If it is negative, it is counted
from the back of the string. In 'ABCDEF', 'F' is at position -1, 'E'
is at position -2 etc.