That depends on what $toplinks is in the excerpt you've shown above and the code (presumably?) that it's used in later. If $toplinks is supposed to be what the name "toplinks" implies, it's probably some HTML link code that you intend to use somewhere further down the script?
So, whatever you do on the right side of this assignment:
$toplinks = do_something();
should return this HTML link code (in this example, we can presume the function "do_something()" returns code that is assigned to the variable $toplinks for later use in a template or print/echo statement).