PHP Code:
<?php
global $something;
foreach ($vbulletin->forumcache as $forumdata)
{
if ( strpos($forumdata["description"], '<!-- something -->') !== false )
{
$something[] = $forumdata["forumid"];
}
This will make the variable $something that is in the namespace of the calling script (ie. outside the function) accessible within the function. If the variable has not been defined/used yet it will be created implicit on the first use. If you now set $something to a value in your function, it will be accessible outside the function.
For adding new options to a Forum, see:
https://vborg.vbsupport.ru/showthread.php?t=93445