Tuesday, June 3, 2008

php web design and development and E-learning, tutorial, php educational materials

Welcome to the leading Website Development and E-learning Company India and abroad

Welcome to Webinfology for all your web design and web development requirements. We offer services towards web designs, web application development, Oscommerce, Ecommerce Solutions, Offshore staffing, Offshore Outsourcing, ERP Softwares, Multimedia and Search Engine Optimization. We are a leading software outsourcing company in India and abroad. We help you and your business take a step further with the exposure you need to the web of globalization. We not only design and develop the web application, we also provide a consistent technical support for your business to run smoothly and grow gradually.  more

E-learning:
Webinfology is made up website with development professionals with many years of combined experience in IT and Internet related services, such as website design, web hosting, and web development with developer
We are also provide free E=Learning tutorial jaust opnen site and read and learn all tutorial would you want like php, javascript, perl, asp.net, java.  more

WEBSITE DESIGN

We offer website design services to small and medi-
um level companies. We position ourselves as one of the leading website design company India and aborad and continue to serve and support our customers in achieving their business goal through their websites.  more

WEBSITE DEVELOPMENT

Webinfology specializes in developing web applic-
ations using all the latest web technologies
(PHP, .NET, ASP, AJAX, XML, Joomla, Oscommerce, Paypal ) and business development process. Our years of experience in developing web applications and web portals has effec-
tively contri buted to our bei-
ng one of the leading web development company India and abroad.  more

Wednesday, April 30, 2008

PHP Array Functions

Introduction

PHP stands for Hypertext Preprocessor and is used as a scripting language that is embedded in HTML and runs on the web server. The PHP code is run on the server when the page is requested

Anyone who knows HTML and the C or C++ language can easily program PHP. PHP uses much of the same syntax of C, but is much easier to use and provides access to variables and their values as submitted using HTML forms without the need to parse information. Also PHP is designed to work easily with most SQL servers including the open source SQL server, MySQL.

PHP code is placed in the body of HTML code. It may be placed in HTML code as follows:

echo "This is a test of PHP!";
?>

The above example will output the quoted text on the HTML page where the PHP code is embedded.

Many webservers support PHP out of the box although depending on the version, they may not support the latest version of PHP (Currently 4). If using PHP on the web, it is wise to run the latest version since it has some security enhancements. If you're just using PHP to learn on a local network using the latest PHP version is not as imperative. For example the Apache webserver that comes with Redhat Linux version 6.1 supports PHP3. Depending on how the webserver is setup, it may be required to name the HTML files that contain PHP code with an extension like ".php4".
Documentation

This manual is a brief synopsis of information as an aid to learning PHP. It provides basic PHP information, then provide examples of some useful PHP functionality including sessions, cookie use, sending mail and using it with SQL. It is not intended completely cover all aspects of PHP. Also, it is assumed that the reader is familiar with HTML and languages similar in type to C or Perl. Much PHP syntax is similar to the C programming language. To supplement this document, the reader should refer to the documents page in the weblinks PHP section for available online and downloadable documentation about PHP.

This document and the documentation at the PHP.org Document Section should be all a reader needs to learn PHP. Specifically the large downloadable PHP Manual which is in both PDF and HTML format is an excellent reference manual outlining the many PHP functions by category.
PHP Syntax

PHP statements end with a semicolon.

PHP supports comments the same as C and C++ using the methods shown below:

// This is a comment
echo "This is a test of PHP!";
?>

/* Line 1 of this comment
Line 2 of this comment */
echo "This is a test of PHP!";
?>

PHP Variables

* PHP variable type is determined by the way in which it is used (context).
* Variable names begin with a dollar sign, $, followed by a letter, then more letters or numbers.

Supported variables include integers, floating point numbers, strings, arrays, and objects.
Predefined Variables

There are additional predefined PHP variables defined in a file called "php.ini". Variables defined in HTML forms are available to the PHP file that the form is submitted to using the HTML form "action" attribute. Also if the PHP document has been called using a HTML form, a variable named $submit is available and may be tested to see if it exists. If it exists, an if statement may be used to display one set of HTML rather then the HTML that would be displayed if it does not exist. The phpinfo() function may be used to get a list of predefined variables.
Typecasting

Typecasting is performed with the type written in parenthesis as follows:

$i = (int) $myrealvalue;

Supported typecasts include (int), (array), (object), (string), (real), (double), and (float).
PHP Array Variables

PHP Array variables may be defined in the following manner:

$tree = array("trunk", "branches", "leaves");

In this case the value:

tree[0]
evaluates to the string "trunk". The statement:

$tree[3]="nuts";

sets a fourth array value to "nuts". In this way, the array, tree, may be dynamically expanded.

An array can be created and expanded in the following manner.

$car[ ]="body";
$car[ ]="engine";
$car[ ]="transmission";
$car[ ]="tires";
String Concatenation

Strings can be added to each other or additional values may be added to a string using the append, "." operator as follows:

echo "The value of my variable is: " . $myvariable;
Operators

The math and logical operators are the same as the C programming language. Variables may be pre-incremented or post incremented or decremented with commands like "++$a;" which does a pre increment.