Comments in PHP In PHP, we use // to make a singleline comment or /* and */ to make a large comment block. Comment is a part of your PHP code that will.

Slides:



Advertisements
Similar presentations
» PHP arrays are lists of values stored in key-value pairs. » Uses of arrays: Many built-in PHP environment variables. Database functions use arrays.
Advertisements

Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: The Basics.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
1 PHP Statement Constructs Server Scripting. 5-2 Basic Statement All Statements end in a semicolon. Statements are delimited from the HTML code by enclosing.
PHP Introduction.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
PHP Intro/Overview Squirrel Book pages Server-side Scripting Everything you need to know in one slide 1.Web server (with PHP “plug-in”) gets a.
© 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5/e Starting Out with C++: Early Objects 5 th Edition Chapter 2 Introduction.
PHP Server-side Programming. PHP  PHP stands for PHP: Hypertext Preprocessor  PHP is interpreted  PHP code is embedded into HTML code  interpreter.
PHP Workshop ‹#› PHP: The Basics. PHP Workshop ‹#› What is it? PHP is a scripting language commonly used on web servers. –Stands for “PHP: Hypertext Preprocessor”
Lecture 2 Introduction to PHP MIS 3501, Spring 2014 Jeremy Shafer Department of MIS Fox School of Business Temple University January 30, 2014.
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
Outline o What is an array ? o Indexed array o Associative array o Multidimensional array.
PHP Overview CS PHP PHP = PHP: Hypertext Preprocessor Server-side scripting language that may be embedded into HTML One goal is to get PHP files.
PHP MOHAMMED SHURRAB TO MISS/ RASHA ATTALLAH. What is PHP? Stands for "PHP Hypertext Preprocessor" Server-side scripting language HTML-embedded Supports.
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
University of Sunderland Lecture 1 Internet Software Architectures Lecture 1: Introduction.
INTERNET APPLICATION DEVELOPMENT For More visit:
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Nael Alian Introduction to PHP
Chap 3 – PHP Quick Start COMP RL Professor Mattos.
Chapter 2 Basic Elements of Java. Chapter Objectives Become familiar with the basic components of a Java program, including methods, special symbols,
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
1 Working with Data Types and Operators. 2 Using Variables and Constants The values stored in computer memory are called variables The values, or data,
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
PHP By Sergio Rodriguez By Sergio Rodriguez. PHP G PHP: Hypertext Preprocessor G Scripting language G PHP: Hypertext Preprocessor G Scripting language.
More arrays Primitive vs. reference parameters. Arrays as parameters to functions.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
Class 2Intro to Databases Goals of this class Include & Require in PHP Generating Random Numbers in PHP Arrays – Numerically Indexed and Associative Program.
Variables and ConstantstMyn1 Variables and Constants PHP stands for: ”PHP: Hypertext Preprocessor”, and it is a server-side programming language. Special.
PHP. What is PHP? PHP stands for PHP: Hypertext Preprocessor PHP is a server-side scripting language, like ASP PHP scripts are executed on the server.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
ITM © Port, KazmanVariables - 1 ITM 352 Data types, Variables.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 16: PHP Types.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
Strings, output, quotes and comments
PHP - 1h. How it works Client requests document Server loads document in memory Server processes document with relevant module (PHP) Server sends XHTML.
CS 105 Perl: Data Types Nathan Clement 15 May 2014.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2: Introduction to C++ Starting Out with C++ Early Objects Sixth.
PHP Workshop ‹#› أطلق إبداعك 2 أطلق إبداعك 2 مدرس معتمد من مركز زووم PHP: The Basics.
PHP Programming with MySQL Slide 3-1 CHAPTER 3 Working with Data Types and Operators.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
 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.
Chapter 1 Introduction to PHP Part 1. Textbook’s Code DOWNLOADS PHP and MySQL for Dynamic Web Sites Complete Set of Scripts.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
 Variables can store data of different types, and different data types can do different things.  PHP supports the following data types:  String  Integer.
Basic Scripting & Variables Yasar Hussain Malik - NISTE.
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
ITM © Port, KazmanVariables - 1 ITM 352 Data types, Variables Class #4.
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
PHP-Basic By- Tanvi Raval. Pre-requisites Before you continue you should have a basic understanding of the following: 1. HTML 2. JavaScript.
PHP Overview. What is PHP Widely available scripting language Free Alternative to Microsoft’s ASP Runs on the Web Server; not in the browser Example:
IST 210: PHP Basics IST 210: Organization of Data IST2101.
PHP using MySQL Database for Web Development (part II)
Session 2 Basics of PHP.
Introduction to PHP Part 1
PHP 5 Syntax.
Web Technologies PHP 5 Basic Language.
PHP (PHP: Hypertext Preprocessor)
PHP Introduction.
PHP Intro/Overview Bird Book pages 1-11,
PHP.
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
PHP an introduction.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Presentation transcript:

Comments in PHP In PHP, we use // to make a singleline comment or /* and */ to make a large comment block. Comment is a part of your PHP code that will not be translated by the PHP engine. You can use it to write documentation of your PHP script describing what the code should do. A comment can span only for one line or span multiple line. COMMENTS AND VARIABELS IN PHP

PHP support three kinds of comment tags : 1. // This is a one line comment 2. # This is a Unix shellstyle comment. It's also a one line comment 3. /*..... */

Use this multi line comment if you need to. example :

example : "; // You won't see me in the output // I'm a one liner comment /* Same thing, you won't see this in the output file */ echo "The above comment spans two lines "; # Hi i'm a Unix shell-style comment # Too bad you can't see me echo "View the source of this file, you'll see no comments here "; ?>

PHP Operators Operators are used to operate on values. PHP Operators This section lists the different operators used in PHP.

Variable Types PHP supports eight primitive types. Four scalar types: ● boolean : expresses truth value, TRUE or FALSE. Any non zero values and non empty string are also counted as TRUE. ● integer : round numbers (5, 0, 123, 555,...) ● float : floatingpoint number or 'double' ( , 23.0,...) ● string : "Hello World", 'PHP and MySQL, etc

Two compound types: ● array ● object And finally two special types: ● resource ( one example is the return value of mysql_connect() function) ● NULL In PHP an array can have numeric key, associative key or both. The value of an array can be of any type. To create an array use the array() language construct like this.

example : array.php 45, "pop" => 50, "bro" => 25); $mixed = array("hello" => "World", 2 => "It's two"; echo "numbers[4] = {$numbers[4]} "; echo "My mom's age is {$age['mom']} "; echo "mixed['hello'] = {$mixed['hello']} "; echo "mixed[2] = {$mixed[2'}"; ?>

When working with arrays there is one function I often used. The print_r() function. Given an array this function will print the values in a format that shows keys and elements printr.php '; print_r($myarray); echo ' '; ?>