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


T
Ternary Operator
This is a very useful technique for assigning a value to a variable while evaluating a statement in the declaration. Remeber that the result of the statement will be the value assigned to the variable.

PHP Code:
$a false;
$foo $a == false"Berry" "Fruit";

print (
$foo);

// will output: "Berry"
// this is the same thing as doing:

$a false;
$foo null//you would have to declare the variable here first if register_globals is off

if ($a == false) {
    
$foo "Berry";
} else {
    
$foo "Fruit";
}

print (
$foo);

// again, outputs: "Berry" 
Click Here For More Information
Types
Types of variables - for example, int, string, float, etc

All times are GMT. The time now is 01:44 AM.

 
     

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