Add classes to menu item based on url
You can read URL with out base path using $_GET['q'] ..

&lt;?php if ( $_GET['q'] == "search" ) : print ('active'); endif; ?&gt;


OR 

You can use current_path API function which does the same...