Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 РЕКЛАМА

 ПОДПИСКА

 ССЫЛКИ
Colocation
Скоростной интернет
Бесплатный интернет
Wi-Fi
Работа в Киеве
Доставка цветов
Мобильные телефоны
VoIP Billing
Музыка и фильмы
AS numbers, IP addresses
Стройматериалы, инструменты
Flowers delivery Kiev

 АНКЕТА
Как Вам ODS?

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.

 РЕКЛАМА

[Links] [Работа в Киеве] [mp3] [Рефераты] [WiFiver.com
Variable functions

Variable functions

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 forth.

Example 12-1. Variable function example


<?php
function foo() {
    echo "In foo()<br>\n";
}

function bar( $arg = '' ) {
    echo "In bar(); argument was '$arg'.<br>\n";
}

$func = 'foo';
$func();
$func = 'bar';
$func( 'test' );
?>
     



With any suggestions or questions please feel free to contact us