PHP BASICS

Hello World Program:



PHP Variables:

There are three types of variables
  1. Global
  2. Local
  3. Static

Global Variable:



Local Variable:



Static Variable:



Data Types:

  1. String
  2. Integer
  3. Float
  4. Array
  5. Object
  6. Null
  7. Boolean


String Manipulation functions:

  1. Finding the length of the string
  2. Count the number of words in a string
  3. Reverse of a string
  4. Search for a specific text within a string
  5. Replace text within a string


Conditional Statements:

  1. if
  2. if...else
  3. if...else ladder
  4. switch


Loops:

  1. while
  2. do... while
  3. for
  4. foreach


Functions:





Reading data from file line by line:



Writing data to a file and read data from same file:



Reading user input from keyboard and writing on the screen:






Previous
« Prev Post