PHP: Funkce - Manual
PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<include_onceArgumenty funkc�>
view the version of this page
Last updated: Thu, 15 Jul 2004

Kapitola 12. Funkce

U�ivatelsky definovan� funkce

Funkce m��e b�t definov�na pomoc� syntaxe podobn� t�to:

function foo ($arg_1, $arg_2, ..., $arg_n)
{
   echo "Uk�zkov� funkce.\n";
   return $retval;
}

Do funkce m��e b�t vlo�en jak�koli platn� PHP k�d, dokonce i definice jin�ch funkc� a t��d.

V PHP 3 mus� b�t funkce definov�ny d��ve, ne� je na n� odkazov�no. V PHP u� tento po�adavek neplat�.

PHP nepodporuje p�et�ov�n� funkc�, nen� mo�n� ani oddefinov�n� nebo p�edefinovan� d��ve deklarovan�ch funkc�.

PHP 3 nepodporuje prom�nn� po�et argument� funkc�, zat�mco implicitn� argumenty jsou podporov�ny (v�ce informac� - viz Implicitn� hodnoty argument�). PHP 4 podporuje oboj�: v�ce informac� - viz Seznam argument� prom�nn� d�lky a reference funkc� func_num_args(), func_get_arg(), a func_get_args().



add a note add a note User Contributed Notes
Funkce
kai at froghh dot de
05-Oct-2004 03:48
if you want to redeclare a PHP-function
using i.e.
function pg_query($args){
...
}

you'll get an error (of course).

To redeclare existing functions the following works:

define(pg_query, pg_query_user);
function pg_query_user($args){
   print "pg_query was used";
}

pg_query("foo");

output: pg_query was used

<include_onceArgumenty funkc�>
 Last updated: Thu, 15 Jul 2004
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2004 The PHP Group
All rights reserved.
This unofficial mirror is operated at: /
Last updated: Sun Nov 14 23:09:54 2004 Local time zone must be set--see zic manual page