Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: PHP Introduction to PHP Introduction to PHP Functions Tutorial

Functions are a very important part of PHP and it is probably safe to say that they are used in every single script. This tutorial will guide you through the basics of PHP functions to creating your own to do specific tasks.

Tutorial Details:

PHP Functions

Functions are a very important part of PHP and it is probably safe to say that they are used in every single script. This tutorial will guide you through the basics of PHP functions to creating your own to do specific tasks.

you're using a function. These are known as built in PHP functions because they are the same and are available on every PHP setup. You can access them in any script without needing to do anything special.

A function can be classed as a subprogram that can act on data and return a value. Each function has its own name and when that name is encountered, the execution of the programme branches off to the first line (or statement) of that function. When the function has completed, it 'returns' and execution resumes from where it left off. A function will perform a specific task and do it well, returning the value you want with the arguments you pass to it.

When you lookup a function on the PHP website e.g explode() , you will see the description of the function, and what it does first. The description then explains how to use the function.

In the case of explode:
array explode ( string separator, string string [, int limit])
This line is known as the prototype. It tells you exactly what the function is and what parameters it should be passed. We can see that it will return an array when you call it, and as parameters (the name of a variable usually passed to a function e.g $split and $string are the parameters in explode($split, $string)), it takes separator, string and limit. Parameters are always within the ( ). The first 2:
( string separator, string string [, int limit])
are required and you must pass arguments (the actual value of the parameter e.g ' ' and 'split this up' are the arguments in explode(' ', 'split this up')) for these when you call the function. If you do not specify a separator or a string, you will get an error. The parameters must also be passed in the order they are listed here. You cannot swap them around.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
PHP Introduction to PHP Introduction to PHP Functions Tutorial

View Tutorial:
PHP Introduction to PHP Introduction to PHP Functions Tutorial

Related Tutorials:

JNDI overview, Part 2: An introduction to directory services - JavaWorld February 2000
JNDI overview, Part 2: An introduction to directory services - JavaWorld February 2000
 
Boost Struts with
Boost Struts with XSLT and XML
 
The Introduction to generic types in JDK 5.0
This tutorial introduces generic types, a new feature in JDK 5.0 that lets you define classes with abstract type parameters that you specify at instantiation time. Generics increase the type safety and maintainability of large programs. Follow along with
 
FreeMarker FreeMarker 2.3.1 an open-source HTML template engine.
FreeMarker provides an easy way to get data from Java servlets into Web pages, and helps you keep graphic design separate from application logic. To use it, you encapsulate HTML in templates.
 
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP.
 
Welcome to the Apache Struts Tutorial
This is the complete Struts Tutorial. Explains ActionForm Action Class Validation Framework.
 
Java RMI Tutorial
This is a brief introduction to Java Remote Method Invocation (RMI). Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space.The other address space could be on the same machine or a different one. The
 

Linux Hosting Plans Proxima Web-Hosting Our basic hosting packages include support for a wide variety of web technologies, backed by instant account management with our Personal Control panel. With our guaranteed
 
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial.
Introduction To Enterprise Java Bean(EJB). WebLogic 6.0 Tutorial. Welcome to EJB Section (Learn to Develop World Class Applications with Enterprise Java Beans) (Online WebLogic 6.0 Tutorial) Introduction To Enterprise Java Bean(EJB) Enterprise
 
Introduction to the JSP Java Server Pages
Introduction to the JSP Java Server Pages Welcome to JSP Section Introduction To JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database
 
Introduction to JSP Declaratives Declarations
Introduction to JSP Declaratives Declarations INTRODUCTION TO JSP DECLARATIVES Syntax of JSP Declaratives are: <%! //java codes %> JSP Declaratives begins with <%! and ends %> with .We can embed any amount of java code in the JSP Declaratives.
 
We are providing Downloadable Version of Mandrake 10.1 Community Edition Linux CD's.
We are providing Downloadable Version of Mandrake 10.1 Community Edition Linux CD's. Mandrake 10.1 Community Edition Linux Now Available Mandrake 10.1 Community Edition CD's Mandrake 10.1 Community, released in Sept. 16, 2004 is an incremental
 
We are providing Downloadable Version of Mandrake 10.1 Official Edition Linux CD's.
We are providing Downloadable Version of Mandrake 10.1 Official Edition Linux CD's. Mandrake 10.1 Official Edition Linux Now Available Mandrake 10.1 Official Edition CD's Mandrakelinux 10.1 Official is a new-generation Linux operating system for
 
We are providing Downloadable Version of Mandrake 10.1 Power Pack Linux CD's.
We are providing Downloadable Version of Mandrake 10.1 Power Pack Linux CD's. Mandrake 10.1 Power Pack Linux Now Available Mandrake 10.1 Power Pack CD's Power Pack is a Linux system that will appeal to all advanced users. It's great for Office
 
Building Search Engine Applications Using Servlets !
Building Search Engine Applications Using Servlets ! Building Search Engine Applications Using Servlets Please visit http://www.webappcabaret.com/javadevelopers/search to see running copy of our search engine. Introduction This tutorial takes
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
Web Hosting Guide. What is Web Hosting Plan?
Web Hosting Guide. What is Web Hosting Plan? What is Web Hosting Plan? Web hosting plan is the different plans provided by Hosting Companies for hosting your web site. Web hosting plans include the storage limit, bandwidth, access to server
 
What is Web Hosting
What is Web Hosting What is Web Hosting? What is Web Hosting? If you have a company and want web presence than you need a website. With the website any one from the world must be able to view your pages, images etc. Website is actually a
 
A Practical Roadmap for Deploying Enterprise Web Applications: Taking the First Step
This article covers important decision points around the availability, scalability, and security that are needed for enterprise web applications.
 
Integrating Java Open Single Sign-On in Pluto
This article shows how to integrate Java Open Single Sign-On in Apache\'s Pluto portlet container.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.