Posts

Showing posts from September, 2017

Php Syntax Detail Discussion

This chapter will give you an idea of very basic syntax of PHP and very important to make your PHP foundation strong. Escaping to PHP The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as 'escaping to PHP'. There are four ways to do this − Canonical PHP tags The most universally effective PHP tag style is − <?php...?> If you use this style, you can be positive that your tags will always be correctly interpreted. Short-open (SGML-style) tags Short or short-open tags look like this − <?...?> Short tags are, as one might expect, the shortest option You must do one of two things to enable PHP to recognize the tags − Choose the --enable-short-tags configuration option when you're building PHP. Set the short_open_tag setting in your php.ini file to on. This option must be disabled to parse XML with PHP because the same syntax is used for XML tags. ASP-style t

Basic Php Syntax and First Example

A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends with ?> Example:                <?php                   // PHP code goes here                ?> The default file extension for PHP files is ".php". A PHP file normally contains HTML tags, and some PHP scripting code. Below, we have an example of a simple PHP file, with a PHP script that uses a built-in PHP function "echo" to output the text "Hello World!" on a web page: Example:                 <!DOCTYPE html>                 <html>                 <body>                  <h1>My first PHP page</h1>                  <?php                  echo "Hello World!";                  ?>                  </body>                  </html>

Uses of PHP

PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them. PHP can handle forms, i.e. gather data from files, save data to a file, through email you can send data, return data to the user. You add, delete, modify elements within your database through PHP. Access cookies variables and set cookies. Using PHP, you can restrict users to access some pages of your website. It can encrypt data.

PHP - Introduction

Image
The first version of PHP way back in 1994. PHP is a recursive acronym for "PHP: Hypertext Preprocessor". PHP is a server side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, even build entire e-commerce sites. It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server. PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the Unix side. The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time. PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added support for Java and distributed object architectures (COM and CORBA), making n-tier development a possibility for the first time. PHP is forgiving: PHP language tries to be as forgiving as possible. PHP Syntax is C-Like.

What is PHP?

Image
PHP is a Programming language that is freely available and used primarily on Linux web server, originally derived from “PERSONAL HOME PAGE” now stands for PHP is “Hypertext Preprocessor” that allows web developers to create dynamic content that interacts with database. PHP is basically used for developing web based software applications.