This document provides an overview of PHP basics including PHP syntax, variables, loops, functions and more. It discusses the different ways to write PHP code such as <?php ?> tags. It also covers PHP variables and data types as well as loops like while, for each and foreach. Functions are defined as reusable blocks of code that can take arguments and return values. Examples are given for each concept to demonstrate how it works in PHP.
Loops execute a block of code a specified number of times, or while a specified condition is true.
Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use loops to perform a task like this.
In PHP, we have the following looping statements:
while - loops through a block of code while a specified condition is true
do...while - loops through a block of code once, and then repeats the loop as long as a specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
Loops execute a block of code a specified number of times, or while a specified condition is true.
Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several almost equal lines in a script we can use loops to perform a task like this.
In PHP, we have the following looping statements:
while - loops through a block of code while a specified condition is true
do...while - loops through a block of code once, and then repeats the loop as long as a specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values.
JavaScript Assignment Operators
Assignment operators are used to assign values to JavaScript variables.
JavaScript String Operators
The + operator, and the += operator can also be used to concatenate (add) strings.
Comparison Operators
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Conditional (Ternary) Operator
The conditional operator assigns a value to a variable based on a condition.
Logical Operators
Logical operators are used to determine the logic between variables or values.
JavaScript Bitwise Operators
Bit operators work on 32 bits numbers. Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.
The delete Operator
The delete operator deletes a property from an object:
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values.
JavaScript Assignment Operators
Assignment operators are used to assign values to JavaScript variables.
JavaScript String Operators
The + operator, and the += operator can also be used to concatenate (add) strings.
Comparison Operators
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Conditional (Ternary) Operator
The conditional operator assigns a value to a variable based on a condition.
Logical Operators
Logical operators are used to determine the logic between variables or values.
JavaScript Bitwise Operators
Bit operators work on 32 bits numbers. Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.
The delete Operator
The delete operator deletes a property from an object:
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
PHP (Hypertext Processor) is a general-purpose scripting language and interpreter that is freely available and widely used for web development. The language is used primarily for server-side scripting, although it can also be used for command-line scripting and, to a limited degree, desktop applications.
PHP is a programming language used to script websites that are dynamic and interactive. You'll find it in various types of web applications, from e-commerce websites to CRM systems like HubSpot and Salesforce. The term PHP stands for PHP Hypertext Preprocessor.
The full form of PHP is Hypertext Preprocessor. It was abbreviated previously as Personal Home Page. It is a programming language widely used to build web applications or websites. It is the server-side scripting language encoded with HTML to develop Dynamic website, Static website or Web applications.
PHP data types are used to hold different types of data or values. PHP supports 8 primitive data types that can be categorized further in 3 types: Scalar Types (predefined) Compound Types (user-defined) Special Types.
Php mysql classes in navi-mumbai,php-mysql course provider-in-navi-mumbai,bes...anshkhurana01
php-mysql classes in navi-mumbai,php-mysql course-provider-in-navi-mumbai,best php-mysql class in navi-mumbai
B2/6/2 Vashi ,Navi Mumbai, Contact:09892900103/9892900173 enquiry@vibrantgroup.co.in
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Sectors of the Indian Economy - Class 10 Study Notes pdf
php basics
1. Presentation on PHP Basics
Submitted to:
Navjot sir
Submitted by:
Ms. Anmol Rattan
1811591
MCA 5th Semester
2. Outlines
PHP Basic Syntax
Case Sensitivity in PHP
PHP Printing function
Declaration of variables
Loops in PHP
Functions in PHP
3. 1. This is most commonly used and recommended
form is:
PHP Basic Syntax
<?PHP
PHP CODE GOES IN HERE
?>
4. 2. This is another way to add PHP script(HTML
or Script style tags)
Syntax:-
<script language=“PHP”>
PHP CODE GOES IN HERE
</script>
5. 3. This is called “Short” tags.
i. Syntax:
<?
PHP CODE GOES
HERE
?>
ii. Syntax:
<%
PHP CODE GOES
HERE
%>
6. Embedding of PHP within HTML
<html>
<body>
<?
// php code goes here
?>
</body>
</html>
7. Case Sensitivity in PHP
In PHP, Variable names are case-sensitive but
function names are not case sensitive.
• If you defined variable in lowercase, then you
need to use it in lowercase everywhere in
program. If we define a
variable $name = "James"; $NAME will not
work
• If you defined function name in lowercase, but
calling them in uppercase it will work. For
example, If we define function sum() {} then
calling SUM() will also work.
8. Case sensitive (both
user defined and PHP
defined)
• variables
• constants
• array keys
• class properties
• class constants
• Strings
Case insensitive (both
user defined and PHP
defined)
• Functions Name
• class constructors
• class methods
• Class Names
• keywords and
constructs (if, else,
null, foreach, echo
etc.)
9. PHP PRINTING FUNCTION
1. print() – The print() is used to create PHP print
statement to print given data to the browser. It is
a PHP language construct and not a function. So,
we can use ‘print’ without parenthesis for
creating a print statement.
11. PHP Echo statement
• It is a construct as like as print(). The difference
is that the echo() will accept multiple data
separated by commas.
• PHP echo statement can be used to print string,
multi line strings, variables, array etc.
13. Declaration of variables in PHP
• A variable in PHP is a name of memory location
that holds data. A variable is used to store data
temporarily.
• In PHP, a variable is declared using $ sign
followed by variable name .
Syntax :-
$variablename=value;
14. Rules for declaring a variable in
PHP
• The variables in PHP are started by the dollar
sign($).
• PHP variables must start with letter or underscore
only.
• PHP variable can't be start with numbers and
special symbols.
• The variables names are case sensitive i.e.
$kushal and $KUSHAL are two different
variables for interpreter.
15. PHP Variable: Declaring string,
integer and float
OUTPUT
string is: hello string
integer is: 200
float is: 44.6
<?php
$str="hello string";
$x=200;
$y=44.6;
echo "string is: $str <br/>";
echo "integer is: $x <br/>";
echo "float is: $y <br/>";
?>
16. Loops in PHP
• When we want to execute same code
multiple times then we can put it into a loop block
to avoid code repetition. Loop structure includes
three sections. These are,
•Initialization
•Conditional execution
•Incrementation / decrementation
17. PHP support four different types of
looping control statements:
1. While Loop
2. Do…While Loop
3. For Loop
4. Foreach Loop
18. 1. While Loop
• while loop is also known a entry control loop.
• In this loop, every time condition is checked and
if condition is true, then block of while loop is
executed.
• Loop will terminate if condition will become
false.
20. 2. Do…While loop
• It is also known as exit controlled loop as in this
condition is checked after executing the block of
loop.
• Do while loop executes a block of code at least
once .
22. 3. For Loop
• The for loop is more fast than while loop and do
while loop.
• It has the initialization, conditional statement and
increments/decrements in a single line.
24. • foreach looping structure is used to iterate through
each element of an array starting from first
element.
• It will depend upon the number of elements of
array that how much time the loop will execute.
• Foreach loop works only on arrays.
4. foreach loop
26. Functions in PHP
• PHP function is a block of statements that can
be reused number of times in PHP script.
• A function can take argument and can return
value.
Syntax:
function functionName()
{
Code to be executed;
}
27. Advantages of PHP Functions
• Code Reusability: PHP functions are defined
only once and can be invoked many times.
• Less Code: It saves a lot of code because By the
use of function, you can write the logic only once
and reuse it.
• Easy to understand: it is easier to understand the
flow of the application because every logic is
divided in the form of functions.
29. PHP functions with arguments
Output
Hello Sonoo
Hello Vimal
Hello John
<?php
function sayHello($name)
{
echo "Hello $name<br/>";
}
sayHello("Sonoo");
sayHello("Vimal");
sayHello("John");
?>
30. Function with return value
Output
sum of 2 and 5 is: 7
<?php
function sum($a, $b){
$c=$a+$b;
return $c;
}
$a=2;$b=5;
echo "sum of $a and $b is:
".sum($a,$b);
?>