Thanks for the reply schestowitz. No the actual function i was trying to use was
<head>
<?php
$current_tab = 'home';
function get_tab($tab,$tab_href,$tab_title) {
global $current_tab;
if ($current_tab == $tab) {
$tab_class = 'tabselected';
} else {
$tab_class = 'tab';
}
echo "
< a href='$tab_href' class='$tab_class'>$tab_title</a >";
}
?>
</head>
<body>
<?php
get_tab('home','/','Welcome');
get_tab('news','/articles/','News');
get_tab('tools','/tools/','Tools');
get_tab('support','/support/','Support');
get_tab('contact','/contact/','Contact');
?>
</body>
$current_tab works fine outside of the function - if i try and echo $current_tab within the function as the link text for instance, nothing is printed so it's like it just hasn't passed into the function, if i echo it in the body tags however it prints fine - so i don't think its a variable collision, unless i'm misunderstanding what you mean by that.
My understanding of php isn't fantastic, so i tired to use a much simpler function for testing purposes just so I could be sure it wasn't get_tab() .
Thanks for your suggestion though, any more ideas? ...pretty please