nweb: a tiny, safe Web server (static pages only)
http://www-128.ibm.com/developerworks/systems/library/es-nweb.html?ca=drs–
http://www-128.ibm.com/developerworks/systems/library/es-nweb.html?ca=drs–
Concatenar strings $str1 = “hola “;$str2 = “que tal “;$str3= “como estas?”; $str4 = $str1.$str2.$str3; Strings CharsSe pueden reemplazar los caracteres:$str1 = «0123456789″;$str1[2]=»x«; Cambiar a mayusculas y minúsculas:strtoupper();strtolower(); Capitaliza la primera letra:ucfirst(); Capitaliza todas las letras:ucwords();ASCII chr(32) = spacechr(65) = A ord(“A”) = 65; Tags: strings
unset() Syntax: void unset(mixed var [, mixed var, …])var Variable to unset. Unsets a variable. unset() destroys one or more variables and deallocates the memory associated with them. Code: <?php $a = «Some data»; unset($a); if (!isset($a)) { print «\$a is no longer available»; } ?> Output: $a is no longer available
¿ Que es PHP ? Scripting / Programming Language (“C – Like”) FREE and Open Source Fast, Open, Stable, Cross Platform! No compilation! PHP is all about “Community”
Navigator Object Determine details of the user browser appName – browser application name appVersion – string containing version details cookieEnabled – boolean value mimeTypes – array of known types of files plugins – array of plug-in application platform – operating system http://www.devguru.com/technologies/javascript/11226.asp Tags: detecting+browser, javascript
Why develop objects? Data hiding Code elegance Code reuse Script stability Steps for developing custom objects Design properties and methods Create constructor functions Develop methods Bind methods to objects
information that describes the object functions that change the state of the object Duality of the object variable -> functionproperty (information about the object)-> method (what the object can do)attribute->behaviourdescription->actionadjetive->verb Encapsulation Binding data and functions Provides robust and secure set of elements simple interface hide details class an object prototype Object instantaion with instructions… Leer más »
document.write(«<h1>String Methods</h1>»); var sample_string = «AaBbCcDdEeFfGg»; document.write(«<br>Orignal String: » + sample_string); document.write(«<h2>Formatting</h2>»); document.write(«<br>toLowerCase: » + sample_string.toLowerCase()); document.write(«<br>toUpperCase: » + sample_string.toUpperCase()); document.write(«<br>bold: » + sample_string.bold()); document.write(«<br>italics: » + sample_string.italics()); document.write(«<br>strike: » + sample_string.strike()); document.write(«<br>big: » + sample_string.big()); document.write(«<br>small: » + sample_string.small()); document.write(«<br>sup: » + sample_string.sup()); document.write(«<br>sub: » + sample_string.sub()); document.write(«<br>fixed: » + sample_string.fixed()); document.write(«<br>fontcolor(red): » +… Leer más »
tempDate = new Date(); document.write(«Fecha: » + tempDate.toLocaleString()); otraFecha = new Date(2007, 04, 11, 10, 52, 30); document.write(«<br> Otra Fecha:» + otraFecha + «<br>»); document.write(«Date: » + otraFecha.getDate() +»<br>»); document.write(«Month: » + otraFecha.getMonth() +»<br>»); document.write(«Year: » + otraFecha.getYear() +»<br>»); document.write(«Locale String: » + otraFecha.toLocaleString() +»<br»); Tags: date, javascript
/* FUNCTIONS */ function hola_usuario() { document.write(«Hola que tal <br>») } function raiz(x) { return x * x ; } hola_usuario(); numero=prompt(«Ingresa un numero», 0); document.write(raiz(numero)); Tags: funciones, functions