smike
Новичок
function и require
index.php
function.php
include.php вариант №1
include.php вариант №2
В перовом варианте index.php выводит 'result', во втором ничего не выводит. Почему?
index.php
PHP:
<?
require('function.php');
echo test();
?>
PHP:
<?
function test()
{
$result=false;
require('include.php');
return $result;
}
?>
PHP:
<?
$result='result';
?>
PHP:
<?
return 'result';
?>