开发者

Get a while loop into a Code Igniter dropdown array

开发者 https://www.devze.com 2023-02-17 20:39 出处:网络
I\'m trying to add a set of dummy options to my dropdown to make some jQuery code work. The problem is that although the loop is working I can\'t figure ou开发者_Go百科t how to set the drop down to lo

I'm trying to add a set of dummy options to my dropdown to make some jQuery code work. The problem is that although the loop is working I can't figure ou开发者_Go百科t how to set the drop down to loop though and get all 50 dummy values it just returns the first one. I know this is like beginner PHP stuff but loops and arrays seem to always be confusing to me.

$dummy_value = array('UNASSIGNED');
while ($i <= 50)
{
    $dummy_value = "''=> 'null'";
    $i++;
}

echo form_dropdown('employee_manager',array('null'  => 'Please Select A Manager', $dummy_value)); ?>

Ideally I want the form_dropdown to contain 50 of ''=> null vaules. In theory we could add the whole array including the first option to the loop or a variable (I think)


$dummy_value [] = "''=> 'null'";
0

精彩评论

暂无评论...
验证码 换一张
取 消