TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Glossary Navigation
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | All


F
For
A type of loop designed for looping through code when you know how many times you want to go though it.

Examples
PHP Code:
for($i=0;$i<8;$i++)
{
    echo 
"I have looped though $i times<br />";

Foreach
Foreach is a way to loop over elements in an array.

Examples:
Taken from http://us.php.net/foreach
PHP Code:
<?php
$arr 
= array(1234);
foreach (
$arr as &$value) {
    
$value $value 2;
}
// $arr is now array(2, 4, 6, 8)
unset($value); // break the reference with the last element
?>
Formatting
This generally refers to the layout and readabilty of your PHP code. Good formatting includes correctly indented blocks and proper use of whitespace
Function
A function is a reuseable block of code that you can run as required. A function definition would look something like:

PHP Code:
function myFunction()
{
    
// function content here

You would then run your custom function as you would a normal function:

PHP Code:
myFunction(); 
In Object-Orientated Programming, functions are also known as Methods.

All times are GMT. The time now is 08:51 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design