Introdução às Linguagens de Programação/PHP: diferenças entre revisões

Conteúdo apagado Conteúdo adicionado
Linha 79:
</source>
O exemplo acima demonstra três maneiras diferentes de declarar vetores.
 
===Functions===
PHP has hundreds of base functions and thousands more via extensions. These functions are well documented on the PHP site; however, the built-in library has a wide variety of naming conventions and inconsistencies.<ref>{{cite web|title=Problems with PHP|url=http://toykeeper.net/soapbox/php_problems/|accessdate=20 December 2010}}</ref> PHP currently has no functions for [[Thread (computer science)|thread]] programming, although it does support multiprocess programming on [[POSIX]] systems.<ref>{{cite web|accessdate=2009-08-06|url=http://nz.php.net/manual/en/book.pcntl.php|title=PHP.NET: Process Control}}</ref><br />
Additional functions can be defined by a developer:
 
 
<source lang=php>
function myFunction() { //declares a function, this is named myFunction
return 'John Doe'; //returns the value 'John Doe'
}
 
echo 'My name is ' . myFunction() . '!'; //outputs the text and the return variable of the myFunction, the function is also called
//the result of the output will be 'My name is John Doe!'
</source>
 
==Vantagens de Uso==