Tampilkan Iklan anda disini

Friday, 17 August 2018

INTEGERS PHP


INTEGERS PHP

Integers

An integer is a number of the set ℤ = {..., -2, -1, 0, 1, 2, ...}. 
DISINI MUNGKIN

loading...

BOOLEANS



Booleans

This is the simplest type. A boolean expresses a truth value. Itcan be either TRUE or FALSE. 


Syntax

To specify a boolean literal, use the constants TRUE or FALSE. Both are case-insensitive. 



<?php
$foo = True; // assign the value TRUE to $foo
?>  

Typically, the result of an operatorwhich returns a boolean value is passed on to a control structure. 



<?php
// == is an operator which tests
// equality and returns a boolean
if ($action == "show_version") {
    echo "The version is 1.23";
}

// this is not necessary...
if ($show_separators == TRUE) {
    echo "<hr>\n";
}

// ...because this can be used with exactly the same meaning:
if ($show_separators) {
    echo "<hr>\n";
}
?>  


Converting to boolean

To explicitly convert a value to boolean, use the (bool) or (boolean) casts. However, inmost cases the cast is unnecessary, since a value will be automaticallyconverted if an operator, function or control structure requires a boolean argument. 

See also Type Juggling. 

When converting to boolean, the following values are considered FALSE: 
• the boolean FALSE itself  
• the integer 0 (zero)  
• the float 0.0 (zero)  
• the empty string, and the string "0"  
• an array with zero elements  
• the special type NULL (includingunset variables)  
• SimpleXML objects created from emptytags  

Every other value is considered TRUE (including any resource and NAN). 

Warning 
-1 is considered TRUE, like any other non-zero(whether negative or positive) number! 



<?php
var_dump((bool) "");        // bool(false)
var_dump((bool) 1);         // bool(true)
var_dump((bool) -2);        // bool(true)
var_dump((bool) "foo");     // bool(true)
var_dump((bool) 2.3e5);     // bool(true)
var_dump((bool) array(12)); // bool(true)
var_dump((bool) array());   // bool(false)
var_dump((bool) "false");   // bool(true)
DISINI MUNGKIN

loading...

PHP TYPES


Introduction

PHP supports ten primitive types. 
DISINI MUNGKIN

loading...

Wednesday, 4 July 2018

PHP tags



PHP tags

When PHP parses a file, it looks for opening and closing tags, which are <?php and ?> which tell PHP to start and stop interpreting the code between them. Parsing in this manner allows PHP to be embedded in all sorts of different documents, as everything outside of a pair of opening and closing tags is ignored by the PHP parser. 

DISINI MUNGKIN

loading...

Runtime Configuration



The configuration file

The configuration file (php.ini) is read when PHP starts up. For the server module versions of PHP, this happens only once when the web server is started. For the CGI and CLI versions, it happens on every invocation. 
DISINI MUNGKIN

loading...

Problems? PHP



Problems?

Read the FAQ

Some problems are more common than others. The most common ones are listed in the PHP FAQ, part of this manual
DISINI MUNGKIN

loading...

Installation of PECL extensions



Introduction to PECL Installations

» PECL is a repository of PHP extensions that are made available to you via the » PEAR packaging system. This section of the manual is intended to demonstrate how to obtain and install PECL extensions. 

DISINI MUNGKIN

loading...
luvne.com ayeey.com cicicookies.com mbepp.com kumpulanrumusnya.comnya.com tipscantiknya.com

 
Design by NewWpThemes | Blogger Theme by Lasantha - PremiumBloggerTemplates.com | BTheme.net