
























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
php - php
Typology: Lecture notes
1 / 64
This page cannot be seen from the preview
Don't miss anything!
Ceuturion University of Technology and Management
1
Ceuturion University of Technology and Management
2
http://howtoubuntu.org/how-to-install-lamp-on-
ubuntu
https://www.digitalocean.com/community/tutoria
ls/how-to-install-linux-apache-mysql-php-lamp-
stack-on-ubuntu
Sublime Editor for LINUX platform
http://monkeyhacks.com/post/how-to-install-
sublime-text-2-on-ubuntu-14-
Ceuturion University of Technology and Management
4
PHP code from other elements in the page.
PHP ’.
tag
<?php
// PHP code goes here …
?>
Ceuturion University of Technology and Management
5
A PHP script can be placed
anywhere in the document
A PHP script starts with
The default file extension
for PHP files is “.php”
A PHP file normally
contains HTML tags , and
some PHP scripting code
Ceuturion University of Technology and Management
7
pseudocode algorithms and more detailed explanations when
necessary. The multiline style of commenting is the same as in C
<? / This is a multiline comment*
Author : Shivani Nanda
Purpose: Multiline Comments Demo
Subject: PHP
Ceuturion University of Technology and Management
8
how many whitespace characters you have in a row i.e. one
whitespace character is the same as many such characters
<?
$four = 2 + 2; // single spaces
$four
$four =
2+
2; // multiple lines
?>
Ceuturion University of Technology and Management
10
Ceuturion University of Technology and Management
11
a valid PHP program
assigns a string of characters to a variable called $greeting
Ceuturion University of Technology and Management
13
expressions, we can always put a sequence
of statements anywhere a statement can go by enclosing
them in a set of curly braces
Here both statements are equivalent
if (3 = = 2 + 1)
print(“Good - I haven‘t totally lost my mind ”);
if (3 = = 2 + 1)
{ print(“Good - I haven’t totally”);
print(“lost my mind.
”); }
Ceuturion University of Technology and Management
14
dollar sign ($)
recent assignment
variable on the left-hand side and the expression to
be evaluated on the right
assignment
Ceuturion University of Technology and Management
16
our variables:
4195
Ceuturion University of Technology and Management
17
string operations.’
values
which can package up both other kinds of values and
functions that are specific to the class
resources external to PHP (such as database connections)
Ceuturion University of Technology and Management
19
They are whole numbers, without a decimal
point,
like 4195
They are the simplest type
They correspond to simple whole numbers, both
positive and negative
Ceuturion University of Technology and Management
20
Booleans: TRUE and FALSE