PDA

View Full Version : $vbulletin->options starting from 1


foxfirediego
11-05-2007, 05:22 PM
Hi all, I have the following:

$towns = explode(",", $vbulletin->options['towns']);

and I'm using it here with a while:

$towns[$row[townid]];

in the field I have the following:

$vbulletin->options['towns'] = TownName1, TownName2, TownName3

but my towns list do not start from 0, I have no 0 towns, I have 1, 2 and so on...
But to make it properly I have to type:
Nothing, TownName1, TownName2, TownName3..

how to make it plus 1 before it goes to the while or something?
thank you!

Analogpoint
11-05-2007, 06:30 PM
$towns = explode(",", $vbulletin->options['towns']);
foreach ($towns as $town)
{
// do something with $town.
}

foxfirediego
11-05-2007, 06:46 PM
thanks Analogpoint I'll try that!