first try echo your $filename value what you getting and match like below
if your $filename has correct value then try to echo your text
<li <?php if($filename=='about-us'){echo 'class="current_page_item"';} ?>>
try with
$info = pathinfo($_SERVER['REQUEST_URI']);
$filename = $info['filename'];