index.php:
<?php
require("lib.php");
echo getName();
?>
lib.php:
<?php
$name = "Matej";
function getName() {
return $name;
}
?>
Code doesnt work, i think its becouse PHP cant get variable form outsite of function. how to fix it?