For some reason my PHP function call <? r(); ?> returns a fatal error. Any help?
<?php
//$r is previously assigned
function r() {
echo ( $r );
};
?>
<html>
<head>
<link type="text/css" rel="stylesheet" href="<? r(); ?>rs/css/master.css">
</head>
If you want to refer to a global object from inside an object, you need to explicitly declare it as
global:But in general, referring to global variables in this way is bad style. You should consider passing in prerequisites as function arguments: