Any reason why this would step 2? 'Cause it is...

[php]echo’


'; $groups=file('usergroups.txt'); for($i=0;$i<count($groups);$i++){ echo'<option value="' . $groups[$i] . '>' . $groups[$i] . '</option>'; }[/php] <p>This, for some reason, is stepping two…</p> <p>contents of usergroups.txt:</p> <blockquote>Everyone Administrators only This Group That Group</blockquote> <p>Lemme know if it’s something on my end or whatever.<br> Thanks in advance!</p>

Fixed using this:
[php]$groups=file(‘usergroups.txt’);
for($i=0;$i<count($groups);$i++){
echo’’ . $groups[$i] . ‘’;
}[/php]

Copied from old code and replaced the variable names…

I have no clue how it’s different at all… Care to explain?

It could be the line endings in the file that are causing the issue. Do you edit the file with both Windows and Linux? Do you develop on Windows then run on Linux?

I use Windows for creating and running everything. Notepad++ is the text editor I use all the time. I do not have an eol in the file, but I’m not exploding, just reading into an array.

In:

[php]echo’<option value="’ . $groups[$i] . ‘>’ . $groups[$i] . ‘’;[/php]

You are missing a speech mark before the > in <option. It should be:

[php]echo’’ . $groups[$i] . ‘’;[/php]

Ah okay. Thankshaha

Sponsor our Newsletter | Privacy Policy | Terms of Service