ventics paginas web

Logical Operators

Logical Operators Example Name Result $a and $b And TRUE if both $a and $b are TRUE. $a or $b Or TRUE if either $a or $b is TRUE. $a xor $b Xor TRUE if either $a or $b is TRUE, but not both. ! $a Not TRUE if $a is not TRUE. $a && [...]

Tipos de datos en PHP

El PHP soporta distintos tipos de datos, que no los tiene que impostar el programador, sino que son asumidos directamente por el motor, siempre que el programador no cambie el tipo (utilizando la función settype() ). Los datos pueden ser: Integer; Floating Point number; String; Array; Object.Vamos a verlos de uno en uno. Integer Los [...]

Librerías para Generar PDF con PHP

Estas son alguna librerías con las que podemos generar archivos pdf, bien personalizados , mediante código php.. FPDF: es una de las mas completas y usadas, Web de FPDF, Tutoriales de FPDF, Descargar FPDF TCPDF: esta hecha para php4 y 5, es opensource, Web de TCPDF, Tutoriales de TCPDF, Descargar TCPDF R&OS: permite tener un [...]

Redondear decimales en PHP

Entre las funciones matemáticas de PHP se encuentra una que nos permite redondear un float (número en coma flotante o número con decimales) al valor entero más próximo. Se trata de la función round(). Para explicar su uso, lo mejor es verlo con un par de ejemplos: round(0.6) devolvería el valor entero 1. round(7.3) devolvería [...]

Perl and PHP Regular Expressions

  PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and [...]

Classes and Objects

The Basics class Basic class definitions begin with the keyword class, followed by a class name, followed by a pair of curly braces which enclose the definitions of the properties and methods belonging to the class. The class name can be any valid label which is a not a PHP reserved word. A valid class [...]

Internal (built-in) functions

PHP comes standard with many functions and constructs. There are also functions that require specific PHP extensions compiled in, otherwise fatal “undefined function” errors will appear. For example, to use image functions such as imagecreatetruecolor(), PHP must be compiled with GD support. Or, to use mysql_connect(), PHP must be compiled with MySQL support. There are [...]

Variable functions on PHP

PHP supports the concept of variable functions. This means that if a variable name has parentheses appended to it, PHP will look for a function with the same name as whatever the variable evaluates to, and will attempt to execute it. Among other things, this can be used to implement callbacks, function tables, and so [...]

Returning values

Values are returned by using the optional return statement. Any type may be returned, including arrays and objects. This causes the function to end its execution immediately and pass control back to the line from which it was called. See return() for more information. Note: If the return() is omitted the value NULL will be [...]

Function arguments

Information may be passed to functions via the argument list, which is a comma-delimited list of expressions. PHP supports passing arguments by value (the default), passing by reference, and default argument values. Variable-length argument lists are also supported, see also the function references for func_num_args(), func_get_arg(), and func_get_args() for more information. Example #1 Passing arrays [...]