PHP Beginners Tutorial

  • PHP discovered by Rasmus Lerdorf in 1995
  • PHP is a server-side scripting language
  • PHP is an acronym for “PHP: Hypertext Preprocessor”.

PHP Syntax :

PHP also allows for short open tags <? and ?> (which are discouraged because they are only available if enabled with short_open_tag php.ini configuration file directive, or if PHP was configured with the –enable-short-tags option.

My First PHP Program :

The default file extension for PHP files is “.php”

Output :

echo and print Statements :

**NOTE** – echo is faster compare to print, echo does not return any value.

PHP String Function :

Some important string functions :

1. strlen() : is used to find the length of string.

example :

2. strpos() : return the character position of the first match.

example :

**NOTE** –┬áThe position of the string “world” in the example above is 6. The reason that it is 6 (and not 7), is that the first character position in the string is 0, and not 1.

3. wordwrap() : wrap a string into a newline.

example :

To be continue…soon

Related Contents to follow