function name($fun)
{
if($$fun($_GET['ss'])) return 'tak';
}
$fun - isset lub empty
dlaczego powyższy kod nie działa?
Fatal error: Function name must be a string in ...
function name($fun)
{
if($$fun($_GET['ss'])) return 'tak';
}
$fun - isset lub empty
dlaczego powyższy kod nie działa?
Fatal error: Function name must be a string in ...
Jak tę funkcję wywołujesz?
A w manualu poszukał?
http://us3.php.net/manual/en/functions.variable-functions.php
function name($fun)
{
if($fun($_GET['ss'])) return 'tak';
}
Tak powinno działać
Sarrus, sek w tym ze nie dziala
Fatal error: Call to undefined function isset()
$zm = name('isset');
dokumentacja isset napisał(a)
Note: Because this is a language construct and not a function, it cannot be called using variable functions.
tak samo echo, print, unset, empty, include i require - to nie są funkcje (mimo że wyglądają podobnie) tylko konstrukcje języka i nie możesz ich tak wywoływać
musisz je najpierw "opakować" w funkcję