It depends on how you define what "page" you're on. Are they in separate PHP scripts (e.g. "item1.php", "item2.php", etc. for each menu item)? Is there a variable in the query string? And so on.
Once you get the page name, you can do a simple if() statement for each link:
<a href="link1.php"<?php if($page == 'link1') echo ' class="active"' ?>>Link 1</a>
<!-- etc. for the rest of the links -->